1. Priority of uncommon symbols in C language:
(1). The priority of the symbol is higher than the symbol *, so *p.f should write (*p). F.
(2). The symbol [] has precedence over the symbol *, so int *p[] and int (*p) [] are two different arrays, the former is an array of type int * and the latter is an int array (the array is a two-dimensional array).
int a = 1;
int *b = &a;
int c[2][2] = {{2,3},{4,5}};
int *p[2] = {&a,b};
int (*OP) [2];
op = c;
printf ("The element stored in the array p is the pointer address:%d%d\n", p[0], p[1]);
printf ("The pointer element inside the array p points to the content:%d%d\n", *p[0], *p[1]);
printf ("Array op is actually a pointer to a two-dimensional array of n rows 2 columns:%d%d\n", op[0], op[1]);
(3). The priority of the symbol () is higher than the symbol *, so int *f () is a function named F and the return pointer is an int * type variable, and int (*f) () is a pointer to a function.
(4). Sign = = and! = has a higher precedence than an assignment statement.
2. C Some uncommon statements:
(1). Int (* f ()) () a function that returns the type as a function pointer.
(2). Int (* f ()) [m] returns a pointer to an array of n rows m columns, which is an int (*) [] type variable.
(3). Int (* f[]) is an array that holds an array of function pointers for functions that return a value of type int and whose argument is null.
3. Function Pointers:
(1). function pointer effect:
Pass to other functions as arguments
As the return value of a function
Save in Array
Point to a different function
Call the underlying function
(2). The function pointer should be compatible with the function it points to, and the specific format of the function pointer declaration is "point to function return value type (*F) (parameter to function)".
(3). Pointer Assignment method:
Explicit conversions: F = &func; (Func is a function, f is a function pointer)
Implicit conversions: F = func;
(4). Call of the pointer function:
Display call: *f ();
Implicit invocation: f ();
A different kind of C language