Mail Archives: djgpp/1998/07/30/09:19:39
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 -