第1个回答 2020-05-20
首先,C和C++中定义结构体是有区别的
//c中定义结构体
struct Node
{
};
//c中创建结构体类型变量
struct Node node; //前面有个struct
//c++中定义结构体
struct Node{
};
//c++中声明创建结构体类型变量 (不需要前缀struct)
Node node;
当然,C中为了简写结构体,常常使用typedef 来起别名。你的第二个例子中,已经给结构体起了一个别名Node,他等效于struct 匿名名称; 所以stuck Node * next相当于
struct struct 匿名名称 *next ;多了一个struct所以报错。本回答被网友采纳