samedi 11 septembre 2021

Why when adding the qualifier const in a pointer declaration with a type-alias makes a const pointer rather than pointer to const? [duplicate]

const char numm = 11;   
typedef char* pstring;
const pstring cstr = &numm; //Error
     

I learned this from C++ Primer, but it didn't quite clarify it for me. Here is a code example.

Aucun commentaire:

Enregistrer un commentaire