Reputation: 41
What would be the tagName and the Ident of the following Declaration?
typedef struct element *list;
struct element {int value; list next};
Would it be possible to declare it like this:
typedef struct element {int value; list next} *list;
Upvotes: 0
Views: 50
Reputation: 89224
The second version does not work because list
is not defined at that point. You would need to explicitly specify the type as struct element*
.
typedef struct element {int value; struct element* next;} *list;
Upvotes: 2