using System;
namespace MyStruct
{
public struct Point
{
public int X, Y;
}
}
namespace MyClass
{
public class Point
{
public int X, Y;
}
}
public class HelloWorld
{
public static void Main()
{
int myInteger = 0;
long myLong = myInteger;
myInteger = (int)myLong;
MyStruct.Point p1 = new MyStruct.Point();
p1.X = 7;
MyStruct.Point p2 = p1;
Console.WriteLine($"p1.X is {p1.X}");
Console.WriteLine($"p2.X is {p2.X}");
p1.X = 9;
Console.WriteLine($"p1.X is {p1.X}");
Console.WriteLine($"p2.X is {p2.X}");
MyClass.Point cp1 = new MyClass.Point();
cp1.X = 7;
MyClass.Point cp2 = cp1;
Console.WriteLine($"cp1.X is {cp1.X}");
Console.WriteLine($"cp2.X is {cp2.X}");
cp1.X = 9;
Console.WriteLine($"cp1.X is {cp1.X}");
Console.WriteLine($"cp2.X is {cp2.X}");
}
}