Mail Archives: djgpp/1998/07/29/08:15:41
Heinrich (hein AT mail DOT index DOT co DOT za) wrote:
> how do i read a file name to the program in the calling statement i.e.
> "c:\resolve test.txt"
Try to get a book how to learn C.
The arguments to your program are given to the main() function if you
have it like:
#include <stdio.h>
int main(int argc, char **argv) {
printf("number of arguments=%i, argv[0]=%s\n", argc, argv[0]);
argc--;
argv++;
printf("rest of argv:");
while (argc > 0)
printf(" %s", *argv);
printf("\n");
}
Try it, and by the way, this isn't a C-coding forum, try something
like: alt.lang.c or something like that.
hth,
Robert.
--
rjvdboon AT cs DOT vu DOT nl | "En dat is niet waar!" sprak (ex?) Staatsecre-
www.cs.vu.nl/~rjvdboon | taris Netelenbos (onderwijs) fel.
- Raw text -