Re: [Dev-C++] Error using void main (void)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: Verne H. B. <ve...@sy...> - 2005-04-21 01:48:33
|
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 |