I’m relatively new to C++, I start by reading C++ Primer 4th edition. It has a section explains about Pointers and Typedefs, start with bellowing code.
typedef string *pstring;
const pstring cstr;
I know that after I define typedef string *pstring; I can use *pstring to declare string variable in my code.
*pstring value1; // both of these line are identical,
string value2; // value 1 and value2 are string
The book continue with const pstring cstr1; and *const string cstr2; are identical. I don’t understand why they’re same declaration?
They are not identical.