c ++中布尔类型返回函数的默认返回值 [英] Default return value of a boolean type return function in c++
本文介绍了c ++中布尔类型返回函数的默认返回值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
根据c ++标准,应该是以下函数的返回值。
bool done()
{
//无返回值
}
解决方案这是未定义的行为 - 任何事情都可能发生。
Possible Duplicate:
Why can you return from a non-void function without returning a value without producing a compiler error?According to the c++ standard what should be the return value of the following function.
bool done() { // no return value }
解决方案This would be undefined behavior - anything can happen.
这篇关于c ++中布尔类型返回函数的默认返回值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文