c returnn有没有方向性?

douban.com, all rights reserved 北京豆网科技有限公司C语言为什么在结尾输入return0或return1对程序没有影响呢 在线等_百度知道
C语言为什么在结尾输入return0或return1对程序没有影响呢 在线等
我有更好的答案
有影响的,有返回值的函数的返回值对下一步的程序流程是可以造成影响的而主函数的return则是返回给操作系统用于表示程序执行状态的主函数中默认规定return 0表示程序正常退出,0返回给操作系统,可以有ERROR_LEVEL查询其他值表示程序运行中出错
如果是return 1呢
表示程序运行不正常不过这个数值的含义并不是硬性规定的,你不用这个数值也可以
表示程序运行不正常但是对程序不影响吧
对主函数来说,通常是没有影响的,但是一些特殊情境下也是有影响的,比如用脚本实现自动化,返回值是会用到的对于其他函数的话,影响还是比较大的
采纳率:47%
来自团队:
这个好像是你定义的
mian()的原因吧
这局话要求返回的类型为整型
return 0 和return
所以好像没影响
其实return
0,或return 1 就是表示程序正常退书不过 如果不是主函数的话 就是表示返回值了
只是返回一个值 对程序肯定不会有影响
1.0有什么用呢
只是返回的值不同
返回值有什么用呢
在主函数里没有什么区别吧,系统默认用0
其他1条回答
为您推荐:
其他类似问题
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。This error doesn't make sense, as the preferred orientation UIInterfaceOrientationLandscapeRight is returned by the supported orientation
-(BOOL)shouldAutorotate
return NO;
-(NSUInteger)supportedInterfaceOrientations
return (UIInterfaceOrientationLandscapeRight | UIInterfaceOrientationLandscapeLeft);
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
return UIInterfaceOrientationLandscapeR
Terminating app due to uncaught exception
'UIApplicationInvalidInterfaceOrientation', reason:
'preferredInterfaceOrientationForPresentation must return a supported
interface orientation!'
解决方案 Your code should look like this:
-(BOOL)shouldAutorotate
return NO;
-(NSUInteger)supportedInterfaceOrientations
return UIInterfaceOrientationMaskL
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
return UIInterfaceOrientationLandscapeR
Also, make sure in your Info.plist you have set the correct orientations for you app because what you return from supportedInterfaceOrientations is intersected with the Info.plist and if it can't find a common one then you'll get that error.
本文地址: &
此错误没有意义,因为首选方向 UIInterfaceOrientationLandscapeRight 由支持的方向返回
- (BOOL)shouldAutorotate
{ return NO; }
- (NSUInteger)supportedInterfaceOrientations
{ return(UIInterfaceOrientationLandscapeRight | UIInterfaceOrientationLandscapeLeft); }
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{ return UIInterfaceOrientationLandscapeR }
由于未捕获的异常而终止应用程序'UIApplicationInvalidInterfaceOrientation',原因:'preferredInterfaceOrientationForPresentation必须返回支持的接口方向!'
- (BOOL)shouldAutorotate
{ return NO; }
- (NSUInteger)supportedInterfaceOrientations
{ return UIInterfaceOrientationMaskL }
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{ return UIInterfaceOrientationLandscapeR }
此外,请确保您的 Info.plist 您为应用设置了正确的方向,因为您从 supportedInterfaceOrientations 返回的内容与 Info.plist ,如果它找不到一个通用的,那么你会得到这个错误。
本文地址: &
扫一扫关注官方微信(白天不懂夜的黑)
第三方登录:}

我要回帖

更多关于 return 0 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信