1. pointer:
The pointer is the address. The pointer implements indirect access to the variable. The pointer of the variable is the address of the variable. The variable storing the variable address is the pointer variable;
& -- Get the address operator; get the address of the variable;
* -- Pointer operator (or "indirect access" operator); obtains the content of pointer variable (Address;
Int I = 3;
Int * P; -- Define the pointer Variable P
P = & I; -- equivalent to * P = 3;
2. pointers and arrays:
The array name is the starting address of the array, that is, the pointer (Note: However, the array name represents a fixed address or can be called a pointer constant and cannot be assigned a value, for example, operations such as a ++ are meaningless. Of course, after passing in a function as a real parameter, it can be completely used as a pointer variable in the parameter );
Int A [10];
Int * P;
P = & A [0];
P =;
* P = 1; equivalent to a [0] = 1;
P + I = a + I = & A [I];
* (P + I) = * (a + I) = A [I];
P [I] = * (a + I)
The form of the function participates in the real parameter:
When defining a function, the variable name in the ARC behind the function name is the form parameter. When calling a function in the main function, the parameter in the ARC behind the function name is called the real parameter. Only when a function is called, the memory unit is allocated only when the parameter is called. After the call, the memory unit of the parameter is released. The data transmission of the parameter variable to the parameter variable is value transfer, that is, one-way transmission. Only the real parameter is passed to the parameter, the parameter cannot be returned to the real parameter;