Why is the non-const pointer being treated as a const when using typedef?

Viewed 255
typedef char* c;
const c ptr1 = "pointer";
++ptr1; /// error
const char* ptr2 = "pointer";
++ptr2; /// runs fine

Now ptr1 should be of type const char* and thus a non-const pointer, then why is it being treated as a constant pointer ?

4 Answers
Related