#wrong interpretation confusion on typedef and how it defines its aliases.

6 messages · Page 1 of 1 (latest)

raven oasis
#
typedef char *pstring;

const char *cstr = 0; // wrong interpretation of const pstring cstr
const pstring cstr = 0; // cstr is a constant pointer to char
-----

typedef const char *p_string;

const char *yay = &vi; // wrong interpretation of p_string 
p_string yay2 = &vi;  ```


how are these wrong interpretations?
karmic barnBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

near oyster
#

const pstring is char *const.

raven oasis
near oyster
#

The type qualifier of the pointer itself.

raven oasis
#

oooooooooooooooooooooooooooooooooooooo