I don't get why C++ pros see red when they see void main(). Can someone explain why intmain() is good and void main() bad?
iamboredguy 0 Newbie Poster
Recommended Answers
Jump to Post— Stack Overflow 8Not declaring a function's return value is an error in C++, whether the function is main or not. In C99, the October 1999 revision to Standard C, not declaring a function's return value is also an error (in the previous version of Standard C an implicit int was assumed as …
Jump to Post— hivework 0Operating systems such as UNIX require applications to return an integer value.
0 usually meaning success and non-zero meaning an error.
Jump to Post— John A 1,896>Why is it necessary to have void main() in Java?
I'd say it's because Java applications run in a virtual environment, curtosey of the Java VM. So when a program finishes, it doesn't return to the operating system, it in fact returns to the VM. Therefore rules such asint …
All 9 Replies
Stack Overflow 8 Junior Poster
hivework 0 Newbie Poster
Dave Sinkula 2,398 long time no c Team Colleague
XianBin 0 Newbie Poster
sureshsigera 0 Newbie Poster
Dave Sinkula 2,398 long time no c Team Colleague
madhav_2k -1 Newbie Poster
Salem commented: Yet another off-topic bump of a 2+ year old thread - because java has fuck-all to do with C or C++ -1
John A 1,896 Vampirical Lurker Team Colleague
tux4life commented: I know this is a late REPlie, but your post is definitely worth it :P +23
sujitkumarsingh -6 Newbie Poster
Ancient Dragon commented: what is that supposed to be??? -6
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.