Name: Anonymous 2013-10-24 14:48
Help me understand structs and typedef.
What is the difference between:
struct tag_name{ type member; }
typedef struct tag_name{ type member; } struct_alias;
Why is the tag_name optional in number 2 if there is no self-referential pointer?
When creating an instance of a struct, when do you have to use:
tag_name instance;
and when:
struct tag_name instance;
?
Is using:
typedef struct tag{} alias
making it possible to say:
alias instance;
instead of:
struct tag instance;
?
Also when is the tag needed there?
How do you create an instance of:
typedef struct {} alias
What is the difference between:
struct tag_name{ type member; }
typedef struct tag_name{ type member; } struct_alias;
Why is the tag_name optional in number 2 if there is no self-referential pointer?
When creating an instance of a struct, when do you have to use:
tag_name instance;
and when:
struct tag_name instance;
?
Is using:
typedef struct tag{} alias
making it possible to say:
alias instance;
instead of:
struct tag instance;
?
Also when is the tag needed there?
How do you create an instance of:
typedef struct {} alias