when should i use "return 0;" at the end of a main() function?
MrPapas1991
0
Newbie Poster
Recommended Answers
Jump to Post>when should i use "return 0;" at the end of a main() function?
Always or never, depending on your preference and whether or not you're writing standard C++. In standard C++ 0 is returned automagically when execution falls off the end of main, so the following is perfectly valid:
All 2 Replies
tkud
0
Posting Whiz in Training
Narue
commented:
Begging for rep is unbecoming.
-4
Narue
5,707
Bad Cop
Team Colleague
tkud
commented:
Nicely said.
+0
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.