Mail Archives: djgpp/1997/12/29/12:56:57
Ryan McGee <rdm AT IHateSpam DOT com> wrote:
> why is useing void main() a bad idea? I've heard that all over the place
> but nobody tells me why I shouldn't do that. Does it have something to do
> with error checking? What's going to check the return value of main?
If your program is called by other it WILL check this value. For example: if
it's called from make it will stop the process because it will return error
(most probable).
As main DOES return int you must declare it or the return value is random.
Normally nothing will happend but is a bad practice.
SET
------------------------------------ 0 --------------------------------
Visit my home page: http://set-soft.home.ml.org/
or
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Alternative e-mail: set-sot AT usa DOT net - ICQ: 2951574
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013
- Raw text -