You misunderstand the page. You can either make a typedef
, or define an instance of the structure, but not both.
It might be clearer if you read the whole page and not only syntax block at the top.
Question
In accordance to this Wiki page, it is possible to write the following structure:
typedef struct my_struct {
int integer;
} my_struct_t instance;
K&R do not mention this in "C Proglamming Language". Compiler also returns error during the compilation:
error: expected
=
,,
,;
,asm
, or__attribute__
beforeinstance
Is it a Wiki error or I do something stupid?
Solution
You misunderstand the page. You can either make a typedef
, or define an instance of the structure, but not both.
It might be clearer if you read the whole page and not only syntax block at the top.