cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
"return 0" in the function (not end of f
"return 0" in the function (not end of function)
Nov 16, 2013 at 11:26am UTC
enemy
(470)
Hello!
Please, if we put "return 0" somewhere in the function (not main) where it is NOT the end of the function, will the result be finishing of the function on that place, no matter what happens later (if()..retorn 0)?
Many thanks!
Nov 16, 2013 at 11:34am UTC
The illusionist mirage
(235)
Yes, if your function returns a value, it'll return the first return statement it encounters(keeping in mind flow of control, etc.).
Topic archived. No new replies allowed.