0
C# How to get original int value after adding or subtracting?
If I add something to the int var x within the code, for example x++ within a Console.WriteLine() scenario, then the variable changes back to x. How do I change it back to the original variable?
2 Answers
+ 3
You can assign it with its original value again. Isn't it?
+ 1
Simba đ
đ
I don't get you completely, you want to change the value and get the previous one? For example like this:?
int x = 0;
Console.WriteLine(++x):
x = 0;
Console.Write(x);