www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/18/14:56:34

Date: Fri, 18 Dec 1998 14:55:55 -0500 (EST)
From: Daniel Reed <djr AT narnia DOT n DOT ml DOT org>
To: djgpp AT delorie DOT com
Subject: Re: Accessing command line from within DJGPP
In-Reply-To: <367A3863.5658564@lrz-muenchen.de>
Message-ID: <Pine.LNX.4.05.9812181453420.22758-100000@narnia.n.ml.org>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Fri, 18 Dec 1998, Marcus Rohrmoser wrote:
) Define main as
) `int main(int argc, char** argv)`
) and you`ll have the number of arguments in `argc` and the values in
) argv[1] to argv[argc]. argv[argc+1] is NULL by definition. argv[0] is
) the program`s name.
Actually, the values go from argv[1] to argv[argc-1], where argv[argc] is
NULL by definition.

The argument count includes *all* arguments, including the very first one
(argv[0]).

-- 
Daniel Reed <n AT ml DOT org>
It is better to be defeated on principle than to win on lies. -- Arthur Calwell

- Raw text -


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