NULL不是关键字!

来源:互联网 发布:盐和避难所 for mac 编辑:程序博客网 时间:2024/05/22 08:06

写了一个头文件,忘记包含iostream,结果就出现了错误,说NULL是未定义的标识符。今后要记住,NULL is not a keyword. It's an identifier defined in some standard headers. You can include #include <cstddef> .

iostream里面包含istream和ostream,而istream和ostream都包含ios,cstddef在ios第47行有包含(GNU):

include <cstdio> // For SEEK_SET, SEEK_CUR, SEEK_END