I\'ve just started learning C with a professional Java background and some (if no too much) C++ knowledge, and I was astonished that this doesn\'t work in C:
str
In C, structs can have two kinds of names: a tag name, and a type name. A tag name can only be used if it's prefixed with struct, like:
struct mytag { int a; }
struct mytag mystruct;
A typedef allows you to define both a tag name and a type name. The type name can be used without a struct prefix:
typedef struct mytag { int a; } mytype;
mytype mystruct; // No struct required