What is a const pointer?A const pointer is not the pointer to constant, it is the constant. For example, int* const ptr; indicates that ptr is a pointer, which is a constant. A pointer is preceded by ‘*’. In the above example it is not, Hence it is not the pointer to constant.
The ptr can not be used to point to another integer. The integer pointed by ptr can be changed. The const pointer can not be changed to point to other memory location, because the pointer is constant
|