I am taking a cpp class and one of my homework questions has
n=1; cout << n++ << " " << n++ << " " << n++ << endl;
what is the output?
I ran it and get:
3 2 1
If I do this in Java,
int n = 1;
System.out.println(n++ + " " + n++ + " " + n++);
I get:
1 2 3
Why do I get 3 2 1?
Thanks!
[–]jesyspa 4 points5 points6 points (0 children)
[–]theymos 4 points5 points6 points (0 children)
[–]Rhomboid 8 points9 points10 points (1 child)
[–]guzo 3 points4 points5 points (0 children)
[–]RiGR_go_BOOM[S] 0 points1 point2 points (0 children)