I am a little confused about how the C# compiler handles pre- and post increments and decrements.
When I code the following:
int x = 4;
x = x++ + ++x
In this example,
int x = 4;
x = x++ + ++x;
you can break it like:
x = 4++; which is = 5
x = 4 + ++5; which is 4 + 6
x = 10
Similarly,
int x = 4;
x = x-- - --x;
Here,
x = 4--; which is = 3
x = 4 - --3; which is 4 - 2
x = 2
Simply putting you can say, replace the current value of x, but for every ++ or -- add/subtract a value from x.