Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Point
- {
- public int X { get; set; }
- public int Y { get; set; }
- }
- class B
- {
- public readonly Point P = new Point();
- }
- class Program
- {
- static void Main()
- {
- var b = new B();
- b.P.X = 10; // ちゃんとエラー。P が構造体の時には有効。
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement