Default return value of a boolean type return function in c++

Tal*_*Kit 2 c++

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
}
Run Code Online (Sandbox Code Playgroud)

sha*_*oth 5

This would be undefined behavior - anything can happen.

  • 如果这样做我的计算机会爆炸吗?:) (3认同)
  • @Vlad:爆炸将是符合标准的行为。8v) (2认同)