cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/28/19:35:50

From: Darren Noble <darren AT calderathin DOT com>
To: djgpp AT delorie DOT com
Subject: Re: Command Line parameters
Date: Mon, 28 Jun 1999 17:34:32 -0600
X-Mailer: KMail [version 1.0.17]
References: <19990628174003 DOT 22728 DOT 00000953 AT ng-ch1 DOT aol DOT com>
MIME-Version: 1.0
Message-Id: <99062817374600.00590@dome.calderathin.com>
Reply-To: djgpp AT delorie DOT com

On Mon, 28 Jun 1999, you wrote:
> Could someone show me an example of command line parameters, please.  I'm
> working on a project that would have input like:
> 
> program_name parameter1 parameter2 parameter3
> 
> That sort of thing.
> 
> Thanks,
> Tom Beauchamp

when you declare main use the following syntax:

main(int argc, char argv[])

argc is the number of arguments that are being passed in.
argv[] is a 2 dimesionall array of chars.  0 is the path and the program name
of the program being ran.

- Raw text -


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