typedef struct prefixName
{
char firstName;
char lastName;
} Name_t;
This creates a new name (Name_t) for the type "struct prefixName". If
you leave off "prefixName", then it creates a new name (Name_t) for the
unnamed struct with two char members.
Slightly off-topic... but I have a question.
If you do the following in C:
struct Monkey { int i; };
Then you have to declare objects of it like so:
struct Monkey object;
But if you do the following:
typedef struct Monkey { int i; } Ape;
Then can you declare an object of it as follows:
struct Ape object; //using "struct" prefix
Or can you only do:
Ape object;
I presume that you'd still be able to write:
struct Monkey object;
but NOT:
Monkey object;
-Tomás