Pointer to the array: int (* P) [5];
Defines a one-dimensional array pointing to the number of elements whose array element is int type is 5;
It can also be understood as the first element of a two-dimensional array, as if int * P points to the int type, it can be understood as the first element of a one-dimensional array;
It can also be understood as * P as a pointer. The content in the pointer is an array with 5 Int values; * P = A [5];
The "type specifier" indicates the Data Type of the array. "*" Indicates that the variable after it is a pointer type. "Length" indicates the length of the one-dimensional array, that is, the number of columns of the Two-dimensional array, when the two-dimensional array is divided into multiple one-dimensional arrays. Note: The brackets on both sides of "* (pointer variable name)" are indispensable. If brackets are missing, it indicates a pointer array.
P points to the first element a [0] of a two-dimensional array; its value is equal to a, a [0], & A [0] [0];
P + I is equal to a [I];
* (P + I) + J is equal to a [I] [J];
Pointer array: int * array [5];
Indicates a one-dimensional array with int-type pointers;
Pointer to the function: int (* pfun) (parameter );
The above defines a function pointer to the form parameter whose return value is int type and parameter is parameter pfun.
Typedef int (* pfun) (int A, int B );
Pfun fun;
Int A = (* Fun) (2, 3 );
Returns the pointer function: int * Fun (parameter); returns the pointer to the function:
// The function form is set_handler (void (* f )())
// Return the pointer (the return value is void, and the parameter is the void function)
// It can be understood as void (* TMP )();
// TMP = set_handler (void (* F ())
Void (* set_handler (void (* f )()))()
{
Cout <"set_handler" <Endl;
Return F;
}