return后面还要接break么??
写了个循环语句,if(a=b)
{
if(c=d)
{
switch(e)
{
case f:return g;
case h:return i;
}
else
return j;
}
else
return j;
}
其中一部分大致如上 请问return后面要加break么,还是ruturn后就返回值直接跳出循环了
不用加的,break是跳出循环,不是跳出if语句
这是循环语句吗?
兄弟,你举的例子没说服力!
那你再来看这个例子:
#include <stdio.h>
#include <conio.h>
int f(int e)
{
switch(e)
{
case 0:return 0;
case 1:return 1;
default:return 2;
}
}
main()
{
int e=0;
printf("%d",f(e));
getch();
}