Difference between const char* p and char const* p?

Difference between const char* p and char const* p?

In const char* p, the character pointed by ‘p’ is constant, so u cant change the value of character pointed by p but u can make ‘p’ refer to some other location. in char const* p,

the ptr ‘p’ is constant not the character referenced by it, so u cant make ‘p’ to reference to any other location but u can change the value of the char pointed by ‘p’.

Keywords:
const char
const char* string
difference between char *p and char *p
const pointer
difference between const char and string
pointer to const char array
static const char in c
const char* in cpp

No comments: