I am having trouble when using right to left rule to interpret variable declarations when typedef is involved.
In the C++ primer 5th edition book I saw the following code:
typedef char *pstring;
const pstring cstr = 0; // cstr is a constant pointer to char
const pstring *ps; // ps is a pointer to a constant pointer to char
If I replace the pstring with char * then it stands like this:
const char *cstr
So I expect cstr to be a pointer to a const char. But the comments in the book states the pointer itself is constant. My question is what's wrong with my way of thinking.