J
James Brown
I am defining the following typedefs:
typedef int* pint;
typedef pint* ppint;
typedef ppint* pppint;
taking the last typedef - "pppint" - would this be referred to as:
an alias to type "ppint *" or
an alias to type "int ***"
Or rather, how is it treated by the compiler and the language?
I think it's the latter, could anyone just clarify this please? The former
would produce a kind of "type hierarchy" which chained typedef's together
in a "parent/child" relationship, whereas the latter is just a simple
type-renaming
which always refers to the base type.
(I am writing a _very_ simple compiler which just parses basic
types+typedefs
and want to represent types in the same way a C compiler would).
Thanks,
James
typedef int* pint;
typedef pint* ppint;
typedef ppint* pppint;
taking the last typedef - "pppint" - would this be referred to as:
an alias to type "ppint *" or
an alias to type "int ***"
Or rather, how is it treated by the compiler and the language?
I think it's the latter, could anyone just clarify this please? The former
would produce a kind of "type hierarchy" which chained typedef's together
in a "parent/child" relationship, whereas the latter is just a simple
type-renaming
which always refers to the base type.
(I am writing a _very_ simple compiler which just parses basic
types+typedefs
and want to represent types in the same way a C compiler would).
Thanks,
James