Are they one and the same?

New to c++ and just started reading Arrays and strings but came across a pointer declaration that i need cleared out.
what is the difference between
char * const sPtr;
and
const char * sPtr;
thanks in advance.
No, they are not the same. char * const myVar; means you have a constant pointer to a writable char, while const char * myVar; means you have a writable pointer to a constant char. But, const char *myVar; and char const *myVar; are one and the same.
Consider that there is the case of char const * const myVar; = const char * const myVar; which combines the two cases above and is a const pointer to const char
Topic archived. No new replies allowed.