Mail Archives: djgpp/1997/09/27/14:15:32
Vic <tudor AT cam DOT org> wrote:
> Thomas Jansen wrote:
> > hey, i don't care about the void-thingy, because they are all wrong.. but
> > sometimes it would irritate to some people if they don't see ANYTHING on
> > the screen..
> Actually I said the stuff about the "void" thing because sometimes you
> see a guy asking for help on a bug in his code, and then someone else
> sais "you should use in main blah blah blah". This does not solve the
> guys problem, it has nothing to do with it, it will just piss him off
> and then do you wonder if some people are complaining that this NG is
> not so friendly anymore?
Oh, give me a break, Vic. If you want to go around creating *incorrect code*
all your life, go ahead. According to the ANSI\ISO C standard, the only valid
return type for main() is *int*. Not void or float, *int*. The fact that you
were writing C++ code makes the problem even worse, since the ANSI draft C++
standard, even the rather outdated one the current g++ is based on, says that
main() *must* be declared as returning int, and it is an *error* if it does
not.
"int main()" vs "void main()" might not have anything to do with the person's
problem per se... but is it so wrong to point out correct coding practices to
people that we are, after all, trying to help? I've never seen a poster point
out "you should use 'int main()'" to someone, and not address the real problem
in the same message. Unless, of course, the code in question was given by
someone else as an example, and there is no other problem with it. :)
This newsgroup can be very friendly, but I have to wonder... if you know that
writing "void main(void)..." is going to start some flames... why do you
continue to write it? Just write your code correctly and you'll do fine.
--
[- firewind -]
[- email: firewind AT metroid DOT dyn DOT ml DOT org (home), firewind AT aurdev DOT com (work) -]
[- "You're just jealous because the voices talk to -me-." -]
- Raw text -