c - Can we use typedef struct node node; -
typedef struct node{ int data; struct node *next; }node;
will make difference if use 'node' instead of 'node'
typedef struct node{ int data; struct node *next; }node;
tag names structs, unions, , enums occupy different name space other identifiers (including typedef names), typedef struct node { ... } node;
valid.
struct , union member names occupy yet namespace, following legal, if ill-advised:
typedef struct foo { int foo; } foo;
what can't like
typedef struct foo {...} foo; foo foo;
since both typedef name , variable name occupy same name space.
Comments
Post a Comment