I'm newbie in c++ and i am doing some exercises.
I have a code
#include <cstdlib>
#include <iostream>
using namespace std;
int main(void) {
int i=0;
int a,b,c;
a = i++;
b = i++;
c = i++;
cout << a << b << c;
return 0;
}
and, whe I run it, the result is: 012
But when I run it without variables a, b and c, like in following code
#include <cstdlib>
#include <iostream>
using namespace std;
int main(void) {
int i=0;
cout << i++ << i++ << i++;
return 0;
}
I get result in reverse order: 210
Why is this happening? I think it should be again 012 (I am using NetBeans)