Advertisement
T-D-K

Untitled

Mar 19th, 2018
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1.     struct MyStruct {
  2.         public int Value { get; set; }
  3.  
  4.         public void SetValue(int newValue) {
  5.             Value = newValue;
  6.         }
  7.  
  8.         public MyStruct(int value) {
  9.             Value = value;
  10.         }
  11.     }
  12.  
  13.     class Program {
  14.  
  15.         static MyStruct MyStruct { get; set; }
  16.  
  17.         static void Main(string[] args) {
  18.             MyStruct = new MyStruct(100);
  19.             Console.WriteLine(MyStruct.Value);
  20.             MyStruct.SetValue(777);
  21.             Console.WriteLine(MyStruct.Value);
  22.         }
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement