我是C编程的初学者,但我想知道typedef在定义结构时使用与使用结构之间有什么区别typedef.在我看来,实际上没有区别,他们实现了同样的目标.
struct myStruct{
int one;
int two;
};
Run Code Online (Sandbox Code Playgroud)
与
typedef struct{
int one;
int two;
}myStruct;
Run Code Online (Sandbox Code Playgroud) 如何在此结构的定义中指向下一个结构的指针:
typedef struct A {
int a;
int b;
A* next;
} A;
Run Code Online (Sandbox Code Playgroud)
这是我第一次写它但它不起作用的方式.