Quantcast
Channel: When should I use typedef in C++? - Stack Overflow
Viewing all articles
Browse latest Browse all 14

Answer by xtofl for When should I use typedef in C++?

$
0
0

... and you Don't Need a Typedef for an enum or a struct.

Or do you?

typedef enum { c1, c2 } tMyEnum;typedef struct { int i; double d; } tMyStruct;

can be better written as

enum tMyEnum { c1, c2 }struct  tMyStruct { int i; double d; };

Is that correct? What about C?


Viewing all articles
Browse latest Browse all 14

Latest Images

Trending Articles



Latest Images