From: Erik Max Francis Newsgroups: comp.os.msdos.djgpp Subject: Re: void main ? Date: Thu, 03 Jul 1997 07:32:25 -0700 Organization: Alcyone Systems Lines: 22 Message-ID: <33BBB7F9.7990BD53@alcyone.com> References: NNTP-Posting-Host: newton.alcyone.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Giovanni Resta wrote: > I always declared main as void in the past 5 years and > I never get an error, so I'm curious about the topic. > (I must admit that I never had to test the 'exit code' of a program, > maybe that can change things) There are only two valid ANSI C prototypes for main: int main(void); int main(int argc, char *argv[]); /* the names of the arguments can vary, of course */ This is clearly indicated in section 5.1.2.2.1 of the ANSI C standard. -- Erik Max Francis, &tSftDotIotE / email / max AT alcyone DOT com Alcyone Systems / web / http://www.alcyone.com/max/ San Jose, California, United States / icbm / 37 20 07 N 121 53 38 W \ "Covenants without the sword / are but words." / Camden