“什么是”呢;struct*struct newStruct(int-somedata){};c++; 我试图用C++制作一棵树,碰到了这个令我困惑的代码。< /P> struct node { int data; struct node* left; struct node* right; }; // The code bellow this is the part i dont understand struct node* newNode(int idata) { node* node = new struct node; node->data = idata; node->left = NULL; node->right = NULL; return node; }

“什么是”呢;struct*struct newStruct(int-somedata){};c++; 我试图用C++制作一棵树,碰到了这个令我困惑的代码。< /P> struct node { int data; struct node* left; struct node* right; }; // The code bellow this is the part i dont understand struct node* newNode(int idata) { node* node = new struct node; node->data = idata; node->left = NULL; node->right = NULL; return node; },c++,C++,什么是结构节点*?某种结构,但指针?结构也不应该有在最后?例如,节点具有而不是节点*?结构节点*是函数的返回类型newNode(),本身不是定义。您所指的行是函数newNode的签名。后面是两个大括号{}之间的函数定义。函数定义不需要结尾。结构节点*是函数newNode()的返回类型,而不是其本身的定义。您所指的行是函数newNode的签名。后面是两个大括号{}之间的函数定义。函数定义不需要在结尾。这是C语法。在C++中可以删除关键字结构>代码>。 NeNobs是一个函数,它使用 int ,并返

什么是结构节点*?某种结构,但指针?结构也不应该有
在最后?例如,
节点
具有
而不是
节点*

结构节点*
是函数的返回类型
newNode()
,本身不是定义。您所指的行是函数
newNode
的签名。后面是两个大括号{}之间的函数定义。函数定义不需要
结尾。

结构节点*
是函数
newNode()
的返回类型,而不是其本身的定义。您所指的行是函数
newNode
的签名。后面是两个大括号{}之间的函数定义。函数定义不需要
在结尾。

这是C语法。在C++中可以删除关键字<代码>结构>代码>。<代码> NeNobs是一个函数,它使用<代码> int <代码>,并返回<代码>节点*<代码>指针。这里的代码<结构>节点< /C> >与代码>节点< /代码>相同。冗余代码>结构> /COD>关键字是C语言的残余,几乎不需要在C++中使用。有关更多详细信息,请参阅其C语法。在C++中可以删除关键字<代码>结构>代码>。<代码> NeNobs是一个函数,它使用<代码> int <代码>,并返回<代码>节点*<代码>指针。这里的代码<结构>节点< /C> >与代码>节点< /代码>相同。冗余代码>结构> /COD>关键字是C语言的残余,几乎不需要在C++中使用。有关详细信息,请参阅