Return -1是什么意思 [英] What is mean by Return -1

查看:372
本文介绍了Return -1是什么意思的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


任何机构都可以从任何函数中告诉我Return语句的方法.

例如:-

char func()
{
....
....
....
....
....
return(-1);
}

Return(-1)是什么意思;

谢谢与问候..
库什
7838306975


Could any body tell me means of Return statement from any function.

EX:-

char func()
{
....
....
....
....
....
return (-1);
}

what means by Return(-1);

Thanks & Regards..
kush
7838306975

推荐答案

该函数返回一个值,以便您可以检查该函数的状态.
The function returns a value so that you can check the status of the function.
if (-1 == func())


不要在线发布您的电话号码(如果这是您的电话号码).从函数返回的值的含义取决于返回值的函数和值的类型.如果它是主要功能,则它是成功/失败代码.不知道在使用char的情况下会返回什么.通常,可以将从函数返回的值分配给在另一个函数中声明的变量.因此,函数可以调用其他函数并获取从被调用函数返回的值.
Don''t post your phone number online, if that is your number. The meaning of the value returned from the function depends on the function returning the value and the type of the value. If it''s the main function, it is the success/failure code. Not sure what would be returned in the case of a char. In general, a value returned from a function can be assigned to a variable declared in another function. So, functions can call other functions and get values returned from the called function.


从函数发送回值的唯一方法(在数学意义上,如x = sin(90 ))在C中使用返回.我希望你知道.如果您要问是否返回了负数,它实际上取决于仅程序知道的逻辑.
The only way to send back a value from a function (in a mathematical sense as in x=sin(90)) in C is to use a return. I hope you know that. If you are asking about negative one that is returned, it really depends on the logic that is known only to the program.


这篇关于Return -1是什么意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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