Chapter 9: Problem 11
What is the difference between a pointer to a constant and a constant pointer?
Short Answer
Expert verified
The main difference between a pointer to a constant and a constant pointer lies in what they can modify. A pointer to a constant can change the memory address it points to but not the value it points to, while a constant pointer can modify the value at the memory address but cannot change the address it points to. In terms of syntax, a pointer to a constant is declared as `const dataType* ptrName`, while a constant pointer is declared as `dataType* const ptrName`.