These two concepts are often not clear, and today a good summary of it.
First, the pointer constant
The pointer constant is the first because it is related to the array we use most often.
Declaration of Pointer Constants
intconst p;
The pointer declaration operator is preceded by the constant qualifier const, which is called the pointer constant. Suddenly found a little regularity ^_^.
The const qualifier is decorated with pointers. The array name is a pointer constant. And what is the difference between an array name and a pointer? It is possible to modify the pointed memory by referencing the array name, but it cannot be assigned itself and cannot be used for + +,-operation.
Second, constant pointer
Declaration of a constant pointer
constint * p1;intconst * p2;
Constant Qualifier Const is called a constant pointer in front of the pointer declaration operator *.
The const modifier is the memory address that the pointer points to. The constant pointer and the pointer constant above are the opposite of the assignment behavior. itself can be assigned, support + +,-operation, but not by reference to the pointer to modify the point of memory.
Summary: Remember that the "array name is the pointer constant", this egg-ache problem even solved.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Pointer constants and constant pointers