Forming pointer
Firstly, analyze the change of formal parameters within the scope of the function, as shown in the following figure. The first line is the names of three pointers in turn, the second line is the values of pointers A, B and C (these values are all addresses, and all given here are hypothetical values), and the third line is the values that A, B and C point to the content in turn.

Now analyze the fun function statement. Temp is an integer pointer.

Statement:? temp = a; a = b; B = temperature; The values of pointers A and B (note the address values) are exchanged as follows.

note:

The first sentence temp = a;; Make temp = a = 0x00;;

The second sentence is a = b;; Let a = 0x10;

The third sentence b = temp makes b = 0x00.

Then analyze * temp = * b; in turn; * b = * c; * c = * temp these three statements

( 1)* temp = * b; The value corresponding to address 0x00 has been changed, as shown in the following figure. Because temp and b point to the same memory at this time, the value has not changed:

(2)* b = * c; See the figure below:

(3)* c = * temp; See the figure below:

It can be seen that in the function body, the corresponding values of pointers A, B and C should be 7, 3 and 3 respectively, but notice that temp = A;; a = b; B = temperature; These three sentences change the pointer value, that is, only the copies of the parameters of three pointers in the function body are changed, and the copies will be released after the life cycle of the function, and the original pointers will not be affected. However, it is important to change the value of the pointer to the content in the function body. Therefore, after the function returns, the values (addresses) of pointers A and B passed in by the function are not exchanged, so the result is shown in the following figure: