Created
February 26, 2017 16:56
-
-
Save Drawaes/84704a1a8ce8eb9e3bca6ef364d8beb2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
private static readonly TestStruct _Account = new TestStruct(); | |
static void Main(string[] args) | |
{ | |
Console.WriteLine(_Account.MyMoney); | |
_Account.UpdateValue(100); | |
Console.WriteLine(_Account.MyMoney); | |
Console.WriteLine("Hello World!"); | |
} | |
public class TestStruct | |
{ | |
private int _money; | |
public int MyMoney => _money; | |
public void UpdateValue(int moneyAmount) | |
{ | |
_money += moneyAmount; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
private static readonly TestStruct _Account = new TestStruct(); | |
static void Main(string[] args) | |
{ | |
Console.WriteLine(_Account.MyMoney); | |
_Account.UpdateValue(100); | |
Console.WriteLine(_Account.MyMoney); | |
Console.WriteLine("Hello World!"); | |
} | |
public struct TestStruct | |
{ | |
private int _money; | |
public int MyMoney => _money; | |
public void UpdateValue(int moneyAmount) | |
{ | |
_money += moneyAmount; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment