Here\'s my simple code:
int main() { int x = 5; cout << (x++) << endl; return 0; }
the code above prints 5
5
This is because x++ evaluates the value of x (5 in your case) and will increase its value after that....
x++
what you are looking for is the pre-increment, also ++x
++x