Difference between 'struct' and 'typedef struct' in C++?

前端 未结 8 1628
忘了有多久
忘了有多久 2020-11-21 06:12

In C++, is there any difference between:

struct Foo { ... };

and:

typedef struct { ... } Foo;
8条回答
  •  鱼传尺愫
    2020-11-21 06:46

    Struct is to create a data type. The typedef is to set a nickname for a data type.

提交回复
热议问题