我尝试编译此代码时遇到此结构构造函数的问题:
typedef struct Node
{
Node( int data ) //
{
this->data = data;
previous = NULL; // Compiler indicates here
next = NULL;
}
int data;
Node* previous;
Node* next;
} NODE;
Run Code Online (Sandbox Code Playgroud)
当我来这个错误发生时:
\linkedlist\linkedlist.h||In constructor `Node::Node(int)':|
\linkedlist\linkedlist.h|9|error: `NULL' was not declared in this scope|
||=== Build finished: 1 errors, 0 warnings ===|
Run Code Online (Sandbox Code Playgroud)
最后一个问题是结构,但它在我的main.cpp中运行正常,这次是在头文件中并且给我这个问题.我正在使用Code :: Blocks来编译此代码
我刚安装Eclipse CDT了MinGW.所有环境变量都设置,包括等等.尝试运行一个hello world,一切似乎都很好.
我尝试C在计算机中加载我之前拥有的项目,似乎加载一切正常,但我得到以下错误的NULL符号:
Symbol 'NULL' could not be resolved
Run Code Online (Sandbox Code Playgroud)
任何见解?谢谢!