相关疑难解决方法(0)

为什么NULL未声明?

我尝试编译此代码时遇到此结构构造函数的问题:

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来编译此代码

c++ syntax nodes

79
推荐指数
4
解决办法
17万
查看次数

Eclipse CDT"无法解析符号NULL"

我刚安装Eclipse CDTMinGW.所有环境变量都设置,包括等等.尝试运行一个hello world,一切似乎都很好.

我尝试C在计算机中加载我之前拥有的项目,似乎加载一切正常,但我得到以下错误的NULL符号:

Symbol 'NULL' could not be resolved
Run Code Online (Sandbox Code Playgroud)

任何见解?谢谢!

c eclipse windows mingw eclipse-cdt

27
推荐指数
3
解决办法
8万
查看次数

标签 统计

c ×1

c++ ×1

eclipse ×1

eclipse-cdt ×1

mingw ×1

nodes ×1

syntax ×1

windows ×1