kaveer
8/23/2016 - 6:57 AM

PrefixAndPostfix

PrefixAndPostfix

count++; // postfix increment
++count; // prefix increment
count--; // postfix decrement
--count; // prefix decrement

int x;
x = 42;
Console.WriteLine(x++); // x is now 43, 42 written out
x = 42;
Console.WriteLine(++x); // x is now 43, 43 written out