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 constchar * myVar; means you have a writable pointer to a constant char. But, constchar *myVar; and charconst *myVar; are one and the same.
Consider that there is the case of charconst * const myVar; = constchar * const myVar; which combines the two cases above and is a const pointer to const char