我在下面的声明中有点混淆 - 你能帮忙清理一下吗?
typedef struct {
int a;
int b;
} example;
Run Code Online (Sandbox Code Playgroud)
还有这个
struct something {
int a;
int b;
} ob;
Run Code Online (Sandbox Code Playgroud)
我不确定下面甚至是什么意思?
typedef struct foo {
int a;
int b;
} bar;
Run Code Online (Sandbox Code Playgroud)
typedef struct {
int a;
int b;
} example;
Run Code Online (Sandbox Code Playgroud)
这个定义了一个未命名的结构类型,并example作为该结构类型的类型别名引入.因此,您只能将该结构类型称为"示例".
struct something {
int a;
int b;
} ob;
Run Code Online (Sandbox Code Playgroud)
这个定义了一个结构类型something,并声明了ob该类型的对象.您只能将结构类型称为struct something.
typedef struct foo {
int a;
int b;
} bar;
Run Code Online (Sandbox Code Playgroud)
这个定义了一个名为的结构类型,foo并bar作为该结构类型的类型别名引入.您可以将该结构类型称为struct foo或bar.