Omitting return statement in C++

Omitting the return statement in a non-void function [Except main()] and using the returned value in your code invokes Undefined Behaviour. ISO C++-98[Section 6.6.3/2] A return statement with an expression can be used only in functions returning a value; the value of the expression is returned to the caller of the function. If required, the … Read more