Throughout my life, I cannot find a good explanation of what rules are used to convert a typedef into a C ++ operator. Simple cases that I understand. But consider this from Danny Kalev :
typedef char * pstr; int mystrcmp(const pstr, const pstr); //wrong!
Then Danny Kalev writes:
The sequence const pstr actually means char * const (a const pointer to char); not const char * (pointer to const char.
I cannot find a rule anywhere to explain why "const pstr" will be converted to "char * const".
Thanks for any help.
, pstr char*, const pstr, const (char*), (const char)*.
pstr
char*
const pstr
const (char*)
(const char)*
typedef ; . Typedef , const . , const const.
const
, , , const " " pstr, - . , . typedef char*** pppstr. , a char const***, const pppstr. const , , .
typedef char*** pppstr
char const***
pppstr