I am trying to learn C++ via some web tutorials. I don\'t have a compiler available to me, otherwise I would try this out. I\'m not sure what is meant by a const pointer. Doe
A simple way to remember how const works with pointers is to remember that it always applies to whatever is to the left of it, unless it's the left-most keyword, in which case it applies to the right.
Examples:
Pointer to a constant char: The pointer can be changed to point to something else, but the char it initally points to cannot change value.
const char * p;
Constant pointer to a char: The pointer cannot be changed to point to anything else, but the char it points to can change value.
char *const p;
Constant pointer to a constant char: The pointer cannot be changed to point to anything else, and the char it points to cannot change value.
const char *const p;