If main returns a non-zero value you will get a Run Time Error. However, with a C++ compiler this should not happen
as long as you (a) declare main to return int, and (b) do not explicitly return a non-zero value. If you declare main to have a non-int return type you should get a compile error. It never hurts to have an explicit return 0 at the end of main, though.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article