社区
C语言
帖子详情
为什么这个地方exit(1)会被提示 exit was not declared in this scope
hfxujing1
2016-06-04 11:44:42
\
21行
...全文
1104
4
打赏
收藏
为什么这个地方exit(1)会被提示 exit was not declared in this scope
\ 21行
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
4 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
头发日益减减
2020-04-16
打赏
举报
回复
I了I了
这个bug把我整懵逼了
paschen
2016-06-05
打赏
举报
回复
exit在头文件 <stdlib.h>里
http://en.cppreference.com/w/c/program/exit
小灸舞
版主
2016-06-05
打赏
举报
回复
加上头文件stdlib.h
hfxujing1
2016-06-05
打赏
举报
回复
引用 1 楼 qq423399099 的回复:
加上头文件stdlib.h
版主好啊。我又回来了。 这是教程上的原代码,他的确没有stdlib.h这个头文件
error: ‘
exit
’ was not
declare
d in this
scope
的解决方法
刚开始用linux和G++写程序,碰到的错误可谓是五花八门,如下面的错误 error: ‘
exit
’ was not
declare
d in this
scope
解决方法是 添加 #include 分享到:
C++ 报错 error: ‘xxx’ was not
declare
d in this
scope
笔者在做C++文件的输入输出实验的时候,编译时遇到这样一个问题: error: ‘ofstream’ was not
declare
d in this
scope
经过检查,自己在文件头已经包含了头文件: #include <iostream> #include <fstream> 但是依旧报错,经过检查各种问题都没能找到问题所在。 后来重新对比例程并编译,发现 例程中使用了 using namespace std; 而自己考虑到要少用 using namespace
[编译错误]:
exit
was not
declare
d in this
scope
[编译错误]:
exit
was not
declare
d in this
scope
环境:unbuntu 9.10 g++:4.4.1 在Linux C函数手册中查找
exit
函数的用法,要加入头文件#include 但仍有该错误,后查看书上的相关的源代码,加入,后无此错误。 记录一下。
error: ‘
exit
’ was not
declare
d in this
scope
linux 里面C++编程,使用了
exit
(1)函数出现如下错误: error: ‘
exit
’ was not
declare
d in this
scope
解决: 头文件添加:#include
编译c或c++代码出现error “***” was not
declare
d in this
scope
的解决方法
C++ 中error: ‘
exit
’ was not
declare
d in this
scope
的解决方法 添加头文件#include <cstdlib> error: ‘inet_ntoa’ was not
declare
d in this
scope
#define _BSD_SOURCE #include <sys/socket.h> #includ...
C语言
70,014
社区成员
243,263
社区内容
发帖
与我相关
我的任务
C语言
C语言相关问题讨论
复制链接
扫一扫
分享
社区描述
C语言相关问题讨论
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章