Skip to content
Quiz · Value and reference types · lesson 3 of 11

Quiz — a struct copy

What does the program print?

C#
Point a = new Point();
a.X = 1;
Point b = a;
b.X = 2;
Move(a);
Console.WriteLine(a.X + " " + b.X);

void Move(Point p) { p.X = 10; }

struct Point { public int X; }