示例#1
0
 static void TryToChangePoint(Point2DStruct p)
 {
     p.X++;
     p.Y++;
     Console.WriteLine("Printing inside TryTochange method");
     Console.WriteLine($"({p.X},{p.Y})");
 }
示例#2
0
        static void Main()
        {
            var point = new Point2DStruct(3, -2);

            PrintPoint(point);
            TryToChangePoint(point);
            PrintPoint(point);
            Console.WriteLine("Using Class");
            var pointTwo = new Point2DClass(3, -2);

            PrintPoint(pointTwo);
            TryToChangePoint(pointTwo);
            PrintPoint(pointTwo);
            Console.WriteLine("Changing struc data inside main");
            point.X++;
            point.Y++;
            Console.WriteLine($"({point.X},{point.Y})");
        }
示例#3
0
 static void PrintPoint(Point2DStruct p)
 {
     Console.WriteLine($"({p.X},{p.Y})");
 }