开发者

Default return value of a boolean type return function in c++ [duplicate]

This question already has answers here: 开发者_开发问答 Closed 11 years ago.

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.


Although it returns a value, it is undefined.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜