pointers, arrays, types of recognition, variable parameters of the function.
I. Pointers.
Its essence is the type of address. In many languages there is no such concept at all. But it is the reason why C is flexible, efficient, and invincible in the process-oriented era. Because C's memory model basically corresponds to now von Neumann (von. Neumann) machine model of computer, well achieved the mapping to the machine. But some people never seem to understand the pointer "note 1". "
Note 1:joel Spolsky think so, he believes that the understanding of the pointer is a aptitude, not through training can be achieved HTTP://WWW.JOELONSOFTWARE.COM/PR .../fog0000000073.html
Pointers can point to values, arrays, functions, and of course, they can also be used as values.
Look at the following examples:
int* p;//p is a pointer that points to an integer
int** p;//p is a pointer that points to the second pointer and then to an integer
int (*PA) [3];//pa is a pointer that points to an array of 3 integers
Int (*PF) ();//PF is a pointer to a function that returns an integer
In the fourth section, I will explain the identification of the identifier (identifier) type in detail.
1. What is the type of the pointer itself?
Let's look at the following example: What is the type of int a;//a?
Yes, just get rid of a. Therefore, the type of the pointer itself in the 4 declaration statements above is:
int*
int**
Int (*) [3]
Int (*) ()
They are all compound types, that is, types combined with types. The meanings were as follows:
point to Int (pointer to an integer)
Pointer to pointer to int (pointer to a pointer to an integer)
Pointer to array of 3 ints (pointing to a pointer to an array with three integers)
Pointer to function ' parameter is void ' and return ' value is int (pointer to a function, this function argument is NULL, returned value is an integer)