www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/06/08:47:37

From: Erik Max Francis <max AT alcyone DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: problems with void main(...)
Date: Sat, 05 Jul 1997 17:11:04 -0700
Organization: Alcyone Systems
Lines: 30
Message-ID: <33BEE298.53C16CCE@alcyone.com>
References: <97Jul5.182622gmt+0100 DOT 16642 AT internet01 DOT amc DOT de>
NNTP-Posting-Host: newton.alcyone.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Chris Croughton wrote:

> Where in the ANSI C standard does it say that main
> must have type 'int'?  I can't find it.
> 
> It may say so in the DRAFT C++ standard, but that is
> not yet approved as far as I am aware.
> 
> Please quote the section, because I don't believe that
> it was put into the ANSI C standard.

This is periodically posted, and is in the comp.lang.c FAQ.  The section
is ANSI C 5.1.2.2.1:

    The function called at program startup is named main. . . . It can be
    defined with no parameters:

        int main(void) { /* ... */ }

    or with two parameters . . .:

        int main(int argc, char *argv[]) { /* ... */ }

-- 
       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
                                   \
           "All the gods are dead / except the god of war."
                                 / Eldridge Cleaver

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019