Re: [Dev-C++] Error using void main (void)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: Austin S. <Aus...@co...> - 2005-04-21 15:46:51
|
also, I have found in dev-C++ that you may just use main() without actually initializing it and that it will exit at the end of the = function. ----- Original Message -----=20 From: Verne H. Bohlender=20 To: Dev C++ ; Alfred P. Reaud=20 Sent: Wednesday, April 20, 2005 9:48 PM Subject: Re: [Dev-C++] Error using void main (void) That's what it should say as it really should be=20 int main() or with all the other goodies inside the brackets. If you = read across it says"int main void for the two ( )'s for the void here! Verne=20 The GRIN Genius who knows nothing! Warnings are mostly ignorable, or nice if you like to write clean = portable code. main should always return an int as that's the exit = value that the executable gives to DOS/Win/Linux upon completion. = Source should compile and run with a void main. However, main's exit = value will then always be 0 and therefore useless to test for a certain = execution completion status. Alexsandro Meireles <mei...@gm...> wrote: Hi, all! I tried to use the following expression in Dev-C++ void main (void) The compiler give a warning message "output of main is not int". = Something like that. Although it gives this warning it compilies well. = Why this happens? Main should always have a return type? Tks in advance! --=20 Alexsandro Meireles=20 Alfred P. Reaud |