Advertisement
Guest User

Untitled

a guest
Feb 1st, 2015
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. struct Point
  2. {
  3. public int X { get; set; }
  4. public int Y { get; set; }
  5. }
  6.  
  7. class B
  8. {
  9. public readonly Point P = new Point();
  10. }
  11.  
  12. class Program
  13. {
  14. static void Main()
  15. {
  16. var b = new B();
  17. b.P.X = 10; // ちゃんとエラー。P が構造体の時には有効。
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement