无效功能中的两个出口点? [英] two exiting points in void function?

查看:55
本文介绍了无效功能中的两个出口点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在void函数中退出点?我不想要

退出程序但只是这个功能。


任何答案都赞赏。


L. Westmeier

Is there a way to have to exiting point in a void function? I don''t want
to exit the program but just this function.

Any answers appreciated.

L. Westmeier

推荐答案

在文章< bo ********** @ hahn.informatik.hu -berlin.de>,L。Westmeier写道:
In article <bo**********@hahn.informatik.hu-berlin.de>, L. Westmeier wrote:
有没有办法在void函数中退出点?我不想退出程序而只是退出程序。

任何答案都赞赏。
Is there a way to have to exiting point in a void function? I don''t want
to exit the program but just this function.

Any answers appreciated.



#include< stdio.h> ;


void foo(int e)

{

if(e == 0){

返回;

}


printf(没有提前退出,e ==%d \ n,e); < br $> b $ b}

-

Andreas K?h?ri


#include <stdio.h>

void foo(int e)
{
if (e == 0) {
return;
}

printf("didn''t exit early, e == %d\n", e);
}
--
Andreas K?h?ri


L. Westmeier写道:
L. Westmeier wrote:
有没有办法在void函数中退出点?我不想退出程序而只是退出程序。
Is there a way to have to exiting point in a void function? I don''t want
to exit the program but just this function.




使用return;



Use return;


Grumble写道:
Grumble wrote:
L. Westmeier写道:
L. Westmeier wrote:
有没有办法在void函数中退出点?我不想退出程序而只是退出程序。
Is there a way to have to exiting point in a void function? I don''t
want to exit the program but just this function.



使用return;


Use return;



感谢快速回复:-)


thanks for the fast reply :-)


这篇关于无效功能中的两个出口点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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