The following blocks are outside of main()
and before every function (global scope)
1st block:
struct flight {
int number;
int capacity;
int passengers;
};
With this you can create array,pointer,variable in contrast with writing } var;
(which defines only one variable of this custom data type (struct flight))
2nd block:
typedef struct flight {
int number;
int capacity;
int passengers;
} flight;
Declaring this creates a data type flight without having to write struct flight all the time
My question is why typedef needs flight to be written a second time at the end of a block?
which is a bit confusing (it looks like only a variable of that datatype)