Pointer function pointer array, function pointer Array
Pointer variable analysis principle: Starting from the variable name, combined according to the operator priority, step by step analysis. (SlavePRemove the parentheses after the start.)
Pointer, pointing to what (X), what type of X is
Int * p; // start with P, and first combine with *, indicating that P is a pointer, and then combine with int, indicating that the type of content pointed to by the pointer is int, so P is a pointer to return integer data.
Int * p [3]; // starting from P, it is first combined with [], so P is an array, and then combined with *, indicating that the elements in the array are pointer types, then combined with Int, it indicates that the pointer points to an integer content type. Therefore, P is an array composed of pointers that return integer data;
Int (* p) [3]; // starts from P, first combines with *, indicating that P is a pointer, and then combines, it indicates that the pointer points to an array and then combines it with int, indicating that the elements in the array are integer, so P is a pointer to an array composed of integer data;
Int p (int); // starts from P, and is first combined with (), indicating that P isFunctionThen, go to () to analyze it, indicating that the function has an integer variable parameter, and then combine it with the int, indicating that the return value of the function is an integer data;
Int (* p) (int); // starting from P, it is first combined with the pointer, indicating that P is a pointer and then combined with (), indicating that the pointer points to a function, then it is combined with the int in (), indicating that the function has an int-type parameter, and is combined with the outermost int, indicating that the return value type of the function is int, so P isRefersDirectionWhich has an integer parameter and returns an integerFunction pointer.
A pointer is a special variable. The number stored in it is interpreted as an address in the memory. To understand a pointer, we need to understand four aspects of the pointer:The memory area occupied by the pointer, the value of the pointer, the memory area pointed to by the pointer, and the type of the pointer.,The type to which the Pointer Points.