www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/27/14:15:32

From: firewind <firewind AT metroid DOT dyn DOT ml DOT org>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Please help the newbie!
Date: 27 Sep 1997 16:34:02 GMT
Organization: Netcom
Lines: 36
Message-ID: <60jchq$9mg@dfw-ixnews12.ix.netcom.com>
References: <875153762 DOT 25454 AT dejanews DOT com> <60cpl7$2pk AT sjx-ixn3 DOT ix DOT netcom DOT com> <875206466 DOT 2246 AT dejanews DOT com> <342AC71A DOT BB9 AT cam DOT org> <01bccb3d$c1afd1a0$644e04c3 AT default> <342D05A5 DOT 7EF5 AT cam DOT org>
NNTP-Posting-Host: elp-tx2-12.ix.netcom.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019