我尝试编译此代码时遇到此结构构造函数的问题:
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来编译此代码