C: What is the difference between const char *p, char const *p, and char* const p ?
What is the difference between const char *p, char const *p, and char* const p ?
'const char *p' and 'char const *p' are the same (i.e., p points to a constant character). On the other hand, 'char* const p' means p is a constant pointer pointing to a character, which means we cannot change the pointer p but we can change the character which p is pointing to.




Comments
Log in or create a user account to comment.