I wrote this very simple program:
#include <iostream>
using namespace std;
int main()
{
int x = 0;
cout << x++<<endl;
cout<<++x<<endl;
int y = 0;
cout<<y--<<endl;
cout<<--y<<endl;
return 0;
}
and this is what i got when i ran it:
0
2
0
-2
i use code::blocks for writing the program and my operating system is Ubuntu 12.10. how should i fix my program so i will see 0 1 0 -1 instead?