退出命令 [英] exit command

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

问题描述

在某个

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


-

Mustafa Zaza

解决方案

MZaza< mu ********** @ gmail.comwrites:


在某个

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



(ITYM" function",not notcommand)。


嘿,这是你的主题行!


#include< cstdlib>


....

if(nasty_thing_happened)

std :: exit(EXIT_FAILURE)

....


-

Micah J Cowan

程序员,音乐家,排版爱好者,游戏玩家......
http://micah.cowan.name/


3月6日凌晨2:02,Micah Cowan< mi ... @ hollister .bcsweb.comwrote:


MZaza< mustafa.z ... @ gmail.comwrites:


在某个

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



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


嘿,这是在你的主题行!


#include< cstdlib>


...

if(nasty_thing_happened)

std :: exit(EXIT_FAILURE)

...


-

Micah J. Cowan

程序员,音乐家,排版爱好者,游戏玩家...... http:// micah.cowan.name/



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

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

这是代码,

}

else if(c = = 3)

std :: exit(EXIT_FAILURE);

}

}


系统(暂停);

返回EXIT_SUCCESS;

}


MZaza< mu **** ******@gmail.comwrites:


3月6日凌晨2:02,Micah Cowan< mi ... @ hollister.bcsweb.comwrote:


> MZaza < mustafa.z ... @ gmail.comwrites:


我可以使用什么命令使程序完成后某个

条件?


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

嘿,这是在你的主题行!



< snipped example>


> ; -
Micah J. Cowan
程序员,音乐家,排版爱好者,游戏玩家...... http://micah.cowan.name/



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


>

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

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

这是代码,

}

否则if(c == 3)

std :: exit(EXIT_FAILURE);

}

}


系统(暂停);

返回EXIT_SUCCESS;

}



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

支撑和缩进似乎不匹配,

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


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

演示问题你看到了。


-

Micah J. Cowan

程序员,音乐家,排版爱好者,游戏玩家...... 。
http://micah.cowan.name/


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

--
Mustafa Zaza

解决方案

MZaza <mu**********@gmail.comwrites:

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

(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/


On Mar 6, 2:02 am, Micah Cowan <mi...@hollister.bcsweb.comwrote:

MZaza <mustafa.z...@gmail.comwrites:

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


(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;
}


MZaza <mu**********@gmail.comwrites:

On Mar 6, 2:02 am, Micah Cowan <mi...@hollister.bcsweb.comwrote:

>MZaza <mustafa.z...@gmail.comwrites:

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


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

Heh, it''s in your subject line!

<snipped example>

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

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

>
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;
}

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/


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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆