This article is my learning notes, welcome to reprint, but please note the Source: http://blog.csdn.net/jesson20121020
A pointer expression refers to an expression and the result is a pointer.
Example 1.
Int A, B;
Int array [20];
Int * P;
P = & A; // & A is a pointer expression, because the result of & A is a pointer.
Int ** q = & P; // & P is also a pointer expression.
* Q = & B; // * P and & B are both pointer expressions.
P = array;
P ++; // Similarly, this is a pointer expression.
Example 2.
Char * arr [10];
Char ** Parr = arr; // arr can be seen as a pointer representing the first address of the array. In this way, arr is also a pointer expression.
Char * s;
S = * Parr; // It is easy to see that * Parr is also a pointer expression.
S = * (Parr + 2); // Similarly, * (Parr + 2) is a pointer expression.
Because the result of a pointer expression is a pointer, the pointer expression also meets the four elements of the pointer, that is, the pointer type and the type pointed to by the pointer, the pointer value or the memory address pointed to by the pointer, and the memory occupied by the pointer.
In addition, it should be noted that when the result pointer of a pointer expression has clearly occupied the memory of the pointer itself, the pointer expression is a left value and can be auto-incremented, auto-subtraction. Otherwise, this pointer expression is not a left value. For example, & A in Example 1 is not a left value, because the result pointer without this expression, that is, the address of a does not occupy the memory, so it is not a left value, of course, you cannot perform auto-increment operations, but * Q is a left value, because the Q pointer has been allocated space during definition.
C pointer parsing ------ pointer expression