1#include <iostream>2#include <stdio.h>3 using namespacestd;4 voidBintAintb) {5cout << a <<" "<< b <<Endl;6 }7 voidA () {8 intI=0;9B (++i, i++);Tenprintf"%d\n", i); One } A intMain () { - A (); -}View Code
2,0
1 #include <cstdio>23int main () {4 int Ten ; 5 printf ("%d%d%d\n", a++, + +A, a); 6 return 0 ; 7 }
View Code
1. Before putting parameters into the stack, the compiler will first dispose of the arguments, even if they change the values of some of the parameters,
2. For the a++ operation, the compiler will open a buffer to hold the value of the current a, and then the a operation, when the value is taken from the buffer, rather than directly from a memory address to take.
Finally, verify the theory, a = ten, printf ("%d%d%d%d\n", a++, ++a, A, a++), the result should be: 12 13 13 10!
The reading order of C + + function parameters