Void函数返回值1000 [英] Void function returns value of 1000
本文介绍了Void函数返回值1000的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
它表示无效f()意味着它不返回任何值。但是下面的这个函数确实会向主函数返回一个值1000.我是否正确?
基本上无效的是返回类型。也许它返回一个值但没有返回类型(即int,char,bool)?
展开 | 选择 | 换行 | 行号
解决方案
您的代码(函数)不会向main函数返回任何值。
问候
Dheeraj Joshi
你好Dheeraj
i看到1000作为输出的一部分。 1000从函数返回到main,没有?
你好Deanm007,
你的功能会将1000存储到iaArray [iIndex]中。请找到以下函数返回int。
int funtion(int a)
{
a ++;
返回a;
}
It says all over that void f() means that it returns no value. But this function below does return a value to the main function which is 1000. Am I correct?
Basically void is taking place of a return type. Maybe it returns a value but no return type(ie. int, char, bool)?
Expand|Select|Wrap|Line Numbers
解决方案
Your code(function) do not return any value to main function.
Regards
Dheeraj Joshi
Hi Dheeraj
i see 1000 as part of the output. That 1000 gets returned from the function to main, no?
Hi Deanm007,
Your funtion will store the 1000 into iaArray[iIndex]. please find the below funtion for returning the int.
int funtion(int a)
{
a++;
return a ;
}
这篇关于Void函数返回值1000的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取
|
15天全站免登陆