我正在研究我教授的代码示例,以便更好地了解链接数据结构.
在我们的linked-list.c示例中,教授定义了一个类型Node,如下所示:
typedef struct node {
int data;
struct node *next;
} Node;
Run Code Online (Sandbox Code Playgroud)
小写节点有什么意义?我的印象是你可以写,例如:
typedef struct {
int data;
struct node *next;
} Node;
Run Code Online (Sandbox Code Playgroud)
然后使用Node作为自己的类型.它是否与以下事实有关:如果您不包含小写节点,那么当编译器评估代码时,它将无法理解"struct node*next"的含义?
c ×1