www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/30/09:19:39

From: vcarlos35 AT juno DOT com
To: djgpp AT delorie DOT com
Cc: oieb2f89s AT juno DOT com
Date: Thu, 30 Jul 1998 09:18:52 -0400
Subject: Re: please help {newbie}
Message-ID: <19980730.091921.5903.0.vcarlos35@juno.com>
References: <000001bdbbae$ce26e100$044d08c3 AT arthur>

On Thu, 30 Jul 1998 12:40:08 +0100 "Arthur" <arfa AT clara DOT net> writes:
>> how do i read a file name to the program in the calling statement i.e.
>> "c:\resolve test.txt"
>
>For your main statement, if you use
>
>	int main(int argc, char *argv[])
>
>then argc is the number of parameters passed, and argv is an array of 
>pointers to each parameter. In your case, argv[0] would point to a
string 
>containing 'test.txt'.

argv[0] points to a string containing the path to the executed program
argv[1] points to a string containing "test.txt", the first argument

>
>I've never used it before, but I think what I've said is right.
>
>James Arthur
>jaa AT arfa DOT clara DOT net
>ICQ#15054819
>
>

Karl

- Raw text -


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