What is the difference between const char .....

Q

What's the difference between const char *p, char const *p, and char * const p?

✍: Guest

A

The first two are interchangeable; they declare a pointer to a constant character (you can't change any pointed-to characters). char * const p declares a constant pointer to a (variable) character (i.e. you can't change the pointer).
Read these declarations ``inside out'' to understand them;

2016-01-06, 1115👍, 0💬