purpose of typedef struct etc. ?
I see this kind of thing a lot:
typedef struct
{
//
} name;
or this
typedef enum
{
//
} name;
My question is why do people do this? Does this notation have some kind of special function? Isn't it simpler to write:
struct name
{
//
};
and
enum name
{
//
};
????
Might it have something to do with C vs. C++ if so why do I see this type of notation in purely c++ files which have c++ only code all over the place?
I have never come across an instance where I would even concieve of using the previous method so if somone would be so kind and explain what the point of that is I would be grateful.