Date: Thu, 18 Jul 1996 10:29:39 +0800 (GMT) From: Orlando Andico To: Nissim Chudnoff cc: DJGPP Questions Subject: Re: int main() In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Tue, 16 Jul 1996, Nissim Chudnoff wrote: > A while ago, there was a conversation about 'void main()' vs. 'int main()' > and I wondered if: > > void main() > { > exit(1); > } > > Is the same as > > int main() > { > return(1); > } No it's not. The first method (at least, when I tested it under Linux) would return a random, nonzero (but small magnitude) positive integer, i.e. 2. This is normally used to signal an error condition so it's a bad idea to declare void main(). -- Orlando Andico http://gibson.eee.upd.edu.ph/~orly/ orly AT gibson DOT eee DOT upd DOT edu DOT ph "Who knows what's going to happen, IRC Lab/EE Dept/UP Diliman lottery or car crash, or you'll join a cult."