我可以将第三行的节点更改为node_new还是其他

Can i change node in 3rd line to node_new or something else?

本文关键字:node new 其他 节点 三行 我可以      更新时间:2023-10-16
struct node
{
int data;
node *next;
};

这是用于在链接列表中定义结构的代码。我们可以通过Node_new *在第三行中替换Node *Next *或其他内容?

我们可以用node_new *next在第三行中替换node *next还是其他?

通过将结构的其他部分保持原样, no ,因为它无法实现您可能想要的。

您需要了解结构的含义:

struct node     // this is the type of the node
{
   int data;    // data of node
   node *next;  // pointer to the next node (thus the type has to match)
};