Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct MyStruct {
- public int Value { get; set; }
- public void SetValue(int newValue) {
- Value = newValue;
- }
- public MyStruct(int value) {
- Value = value;
- }
- }
- class Program {
- static MyStruct MyStruct { get; set; }
- static void Main(string[] args) {
- MyStruct = new MyStruct(100);
- Console.WriteLine(MyStruct.Value);
- MyStruct.SetValue(777);
- Console.WriteLine(MyStruct.Value);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement