can anyone explain to me what return does? I know that return(0) stops the program at any given point, but what does returning others do?
Instinctlol 0 Light Poster
Recommended Answers
Jump to Post>In most, if not all OSes; if a program's main function returns an int, 0
>indicates that program execution ended normally.
>Any other value indicates that the program execution ended
>abnormally. In other words an error occurred.
That's required behavior for a C++ implementation. It has nothing to do with …
Jump to Post>I've seen a few odd programs (emphasis on the odd)
>that actually use the bool return type for main...
Once again, it's a requirement that main return the int type.bool main()
is just as wrong asvoid main()
. Some people might use it, but that doesn't mean you …
All 8 Replies
zortec 11 Junior Poster
JasonHippy 739 Practically a Master Poster
Instinctlol 0 Light Poster
zortec 11 Junior Poster
JasonHippy 739 Practically a Master Poster
Narue 5,707 Bad Cop Team Colleague
JasonHippy 739 Practically a Master Poster
Narue 5,707 Bad Cop Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.