我可以将第三行的节点更改为node_new还是其他
Can i change node in 3rd line to node_new or something else?
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)
};
相关文章:
- node-gyp 在 macOS 上未正确链接库
- 如果"new int"返回"int*",那么为什么"new int[n]"不返回"int**"?
- 有没有一种方法可以使用placement new将堆叠对象分配给分配的内存
- 重载运算符new[]的行为取决于析构函数
- 过载'operator new'如何导致无限循环?
- 创建具有 new in 函数和"this is nullptr"异常的对象
- Codelite C++ new project
- 在类c++中使用new声明数组
- g++用户定义的动态链接库上的全局new和delete运算符
- 为什么C++对链表中的下一个节点使用指针,而像 C# 或 Java 这样的语言只使用类 Node 的名称?
- 如果整个应用程序是虚拟映射的,为什么 new 会进行系统调用?
- 在将 new 与指针一起使用时,创建数组的指定长度
- node-gyp 的先有鸡还是先有蛋的问题:指向依赖项中的头文件
- 体系结构x86_64的未定义符号:std:terminate(),typeinfo,运算符delete[],运算符new
- 为什么我的全局 new() 覆盖被绕过了?
- 声明C++数组(带或不带 "new" 关键字)
- 在C++中,如果我可以直接将整数分配给指针而不使用"new",为什么要使用"new"?
- 是否可以使用 new 指定具有宏常量的动态分配数组的元素?
- 在 ubuntu 上安装 node js pulsar 客户端
- "return new node"内存泄漏,我找不到修复它的方法