Struct and Typedef

I want to understand the greate difference between a struct and a typedef struct.

For example:

1.
1
2
3
typedef struct {
    int day, month, year;
} Date;


2.
1
2
3
struct Date{
    int day, month, year;
};


whats the difference?
In C, struct declarations did not introduce type names, a C program that used the second form, would have to write "struct Date variable". (e.g. struct tm start_time;). typedef declarations, however, do introduce new type names, so a C program that used the first form, can just write Date variable;.

In C++, there is no difference other than the first form looking awkward.
Topic archived. No new replies allowed.