c中的exit函数在vc中编译怎么通不过??!

jsjwql 2003-12-24 06:13:09
请问下
正确的c程序在vc中编译时提示:
'exit' : undeclared identifier
这句是:exit();
是不是要加个什么头文件??
...全文
58 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
jsjwql 2003-12-24
  • 打赏
  • 举报
回复
yes
谢谢了!
fanhongfei 2003-12-24
  • 打赏
  • 举报
回复
应该可以了吧?exit应该有参数的。一般给0,代表程序成功而告终。
如果给1,代表程序失败而告终。但对于退出来说,给什么都一样。
只是有时候可能有进一步进行判断的需要。
superbigboy 2003-12-24
  • 打赏
  • 举报
回复
exit后面要带参数
例如:exit 1
fanhongfei 2003-12-24
  • 打赏
  • 举报
回复
你也许没有加参数。
写exit(0)
jsjwql 2003-12-24
  • 打赏
  • 举报
回复
两中方法都用了出现错误:
--------------------Configuration: wql1 - Win32 Debug--------------------
Compiling...
wql.cpp
C:\Documents and Settings\wql\wql.cpp(38) : error C2660: 'exit' : function does not take 0 parameters
C:\Documents and Settings\wql\wql.cpp(55) : error C2660: 'exit' : function does not take 0 parameters
C:\Documents and Settings\wql\wql.cpp(73) : error C2660: 'exit' : function does not take 0 parameters
C:\Documents and Settings\wql\wql.cpp(88) : error C2660: 'exit' : function does not take 0 parameters
C:\Documents and Settings\wql\wql.cpp(106) : error C2660: 'exit' : function does not take 0 parameters
C:\Documents and Settings\wql\wql.cpp(131) : error C2660: 'exit' : function does not take 0 parameters
C:\Documents and Settings\wql\wql.cpp(162) : error C2660: 'exit' : function does not take 0 parameters
Error executing cl.exe.

wql1.exe - 7 error(s), 0 warning(s)
fanhongfei 2003-12-24
  • 打赏
  • 举报
回复
或者是process.h
两个都可以
baudyer 2003-12-24
  • 打赏
  • 举报
回复
stdlib.h

69,371

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧