Re: [Dev-C++] Error using void main (void)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: Alfred P. R. <al...@ya...> - 2005-04-21 01:32:18
|
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! -- Alexsandro Meireles Alfred P. Reaud |