0
Difference between const char* p and char const* p ?
Posted by The Blogger
on
9:22 AM
in
c
Answer:
In const char* p, the character pointed by ‘p’ is constant, so u can't 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 can't make ‘p’ to reference to any other location but u can change the value of the char pointed by ‘p’.
In const char* p, the character pointed by ‘p’ is constant, so u can't 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 can't make ‘p’ to reference to any other location but u can change the value of the char pointed by ‘p’.
Post a Comment