delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/28/20:45:36

From: "Carolyn Kelly-Pajot" <carolynk AT msn DOT com>
References: <199710250712 DOT UAA05497 AT fep1-orange DOT clear DOT net DOT nz>
Subject: Re: Reading the command line
Date: Mon, 27 Oct 1997 11:07:03 -0500
Lines: 45
Message-ID: <eV4YjHv48GA.312@upnetnews02.moswest.msn.net>
Newsgroups: comp.os.msdos.djgpp
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp


Jamie Love wrote in article
<199710250712 DOT UAA05497 AT fep1-orange DOT clear DOT net DOT nz>...

>---------
>> From: H.W. Stockman <hwstock AT swcp DOT com>
>> To: djgpp AT delorie DOT com
>> Subject: Re: Reading the command line
>> Date: Friday, October 24, 1997 09:08
>>
>> Jon Seanor wrote:
>> >
>> > Just a quick question.
>> >
>> > I'm forever forgetting the syntax for reading the command line, i.e.
>passing
>> > it to the main function as parameters.  Do you know what the syntax is?
>> >
>> > void main(char* argv[], int argc)        <---is this right?
>> > {}
>>
>> order reversed -- argc first.  That should be in just
>> about any C book...
>
>Shouldn't the naming be (to be exact and easier to read etc.)
>int main(int argv, char *argv[])
> { }
>
>??
>
>***************************
>J. Love
>Quote of the day:
>
>'Tis folly to be wise.
> -Thomas Gray
>***************************

Give them different names, or cc1 will complain. You can name them Doc and
Sneezy, as long as they are different. There is also an environment, a 3rd,
which is a char *env[] ending with a null pointer. Works exactly like
*argv[]. Call it Grumpy or env.


- Raw text -


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