Order of executions in C++ streams
- by Krzysztof Bzowski
It is obvious that first cout prints 7 7 but why the second one prints 8 8 7 ? Why not 7 8 8? How does such constructions work in c++?
int ink(int *x){
*x += 1;
return *x;
}
int main(){
int *a;
int b = 6;
a = &b;
cout << ++b << " " << b << endl;
cout << b << " " << ink(a) << " " << b;
return 0;
}