错误:未在此范围内声明“NULL" [英] error: ‘NULL’ was not declared in this scope

查看:49
本文介绍了错误:未在此范围内声明“NULL"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 gcc 4.3 上编译 C++ 时收到此消息

I get this message when compiling C++ on gcc 4.3

error: ‘NULL’ was not declared in this scope

它出现又消失,我不知道为什么.为什么?

It appears and disappears and I don't know why. Why?

谢谢.

推荐答案

NULL 不是关键字.它是一些标准头文件中定义的标识符.你可以包括

NULL is not a keyword. It's an identifier defined in some standard headers. You can include

#include <cstddef>

将其纳入范围,包括一些其他基础知识,例如 std::size_t.

To have it in scope, including some other basics, like std::size_t.

这篇关于错误:未在此范围内声明“NULL"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆