www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/03/17:10:10

From: Erik Max Francis <max AT alcyone DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: hope iam in the right place
Date: Tue, 03 Nov 1998 13:58:35 -0800
Organization: Alcyone Systems
Lines: 33
Message-ID: <363F7C8B.6EB959CA@alcyone.com>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 981103105953 DOT 19001F-100000 AT is>
NNTP-Posting-Host: charmaine.alcyone.com
Mime-Version: 1.0
X-Mailer: Mozilla 3.01 (X11; I; Linux 2.0.34 i686)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Eli Zaretskii wrote:

> No, it looks like this:
> 
>         int main (int argc, char **argv);

Nope.  ANSI C 5.1.2.2.1 dictates that the declaration for main must be
either 

    int main(void);

or 

    int main(int argc, char *argv[]);

Note the argument is an array of pointers, not a pointer to a pointer.

> I know, **argv and *argv[] are essentially the same, but the ANSI
> standard explicitly uses the former.

Not sure how pedantic one needs to be on this.  ANSI dictates that an
array argument to a function is _identical_ to a pointer argument of the
same type, so char *argv[] as a function argument really is the same
thing as char **argv.

-- 
Erik Max Francis / email max AT alcyone DOT com / whois mf303 / icq 16063900 
Alcyone Systems / irc maxxon (efnet) / finger max AT sade DOT alcyone DOT com
  San Jose, CA / languages En, Eo / web http://www.alcyone.com/max/
          USA / icbm 37 20 07 N 121 53 38 W / &tSftDotIotE
             \
            / Whoever named it necking was a poor judge of anatomy.
           / Groucho Marx

- Raw text -


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