编译时出现这个错误:
error: 'NULL' was not declared in this scope
解决方式:
在文件开头添加如下代码:
#include <stddef.h>或者
#include <stdlib.h>
或者
#include <cstdlib>
本文介绍了在编程过程中遇到的‘NULL’未声明错误,并提供了三种解决方案:包含<stdio.h>、<stdlib.h>或<cstdlib>头文件。
编译时出现这个错误:
error: 'NULL' was not declared in this scope
解决方式:
在文件开头添加如下代码:
#include <stddef.h>
2625

被折叠的 条评论
为什么被折叠?