From: George Foot Newsgroups: comp.os.msdos.djgpp Subject: Re: ' ^ ' Date: 2 Nov 1997 02:34:19 GMT Organization: Oxford University, England Lines: 27 Message-ID: <63gorb$80v$1@news.ox.ac.uk> References: <621df9$cp9 AT camel12 DOT mindspring DOT com> NNTP-Posting-Host: sable.ox.ac.uk To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On Sat, 1 Nov 1997 14:07:07 -0500 in comp.os.msdos.djgpp Carolyn Kelly-Pajot wrote: : #include : : void main() ^^^^ Yuck. The main function must, must, must return `int'. If you write `void', this compiler silently changes it to `int' anyway. So using a different return type is not only illegal, it also causes the compiler to compile something different from what you write. It's far better to have the compiler compile exactly what you write; so always define the main function to return `int'. Also, put a return statement in the function body. If you compile your code with `-Wall' (as everyone should IMHO), these will be pointed out to you. (I know you only wrote this quickly to demonstrate a point, but it's bad to post incorrect code nevertheless; people who don't know better might, in reading your helpful answer, think that defining `main' with a void return type is valid code, which it isn't. If you don't care in your own code, that's your choice, but when advising others I think incorrect advice can be worse than no advice at all.) -- Regards, george DOT foot AT merton DOT oxford DOT ac DOT uk