本文介绍了退出命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在某个

条件之后我可以使用什么命令来完成程序?


-

Mustafa Zaza

解决方案



(ITYM" function",not notcommand)。


嘿,这是你的主题行!


#include< cstdlib>


....

if(nasty_thing_happened)

std :: exit(EXIT_FAILURE)

....


-

Micah J Cowan

程序员,音乐家,排版爱好者,游戏玩家......




(ITYM" function",not not quot; command")。


嘿,这是在你的主题行!


#include< cstdlib>


...

if(nasty_thing_happened)

std :: exit(EXIT_FAILURE)

...


-

Micah J. Cowan

程序员,音乐家,排版爱好者,游戏玩家......



我收到错误111 C:\Dev-Cpp \ main.cpp期望构造函数,

析构函数,或'''之前的类型转换'

这是代码,

}

else if(c = = 3)

std :: exit(EXIT_FAILURE);

}

}


系统(暂停);

返回EXIT_SUCCESS;

}



(ITYM功能,而不是命令)。

嘿,这是在你的主题行!



< snipped example>



(请剪断签名,除非它们很重要。看起来像某些人/>
行折叠也已完成。)



那不是完整的代码;所以我无法诊断你的问题。我注意到

支撑和缩进似乎不匹配,

相当。可能你在std :: exit()之后有一个额外的右大括号?


无论如何,请发一个最小的,可编译的例子

演示问题你看到了。


-

Micah J. Cowan

程序员,音乐家,排版爱好者,游戏玩家...... 。


What command can I use to make the program quite after a certain
condition?

--
Mustafa Zaza

解决方案

(ITYM "function", not "command").

Heh, it''s in your subject line!

#include <cstdlib>

....
if (nasty_thing_happened)
std::exit(EXIT_FAILURE)
....

--
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/



(ITYM "function", not "command").

Heh, it''s in your subject line!

#include <cstdlib>

...
if (nasty_thing_happened)
std::exit(EXIT_FAILURE)
...

--
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...http://micah.cowan.name/

I get an error "111 C:\Dev-Cpp\main.cpp expected constructor,
destructor, or type conversion before ''('' token"
Here is the code,
}
else if (c==3)
std::exit(EXIT_FAILURE);
}
}

system("PAUSE");
return EXIT_SUCCESS;
}



(ITYM "function", not "command").

Heh, it''s in your subject line!

<snipped example>

(Please snip signatures, unless they''re important. Looks like some
line-folding was also done.)

That''s not complete code; so I can''t diagnose your issue. I do note
that the bracing and indentation don''t seem to match up,
quite. Probably you have an extra closing brace after std::exit()?

In any case, please post a minimal, compilable example that
demonstrates the problem you''re seeing.

--
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/


这篇关于退出命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 10:46