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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -