cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/29/08:15:41

From: rjvdboon AT cs DOT vu DOT nl (Boon van der RJ)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: please help {newbie}
Date: 29 Jul 1998 11:12:16 GMT
Organization: Fac. Wiskunde & Informatica, VU, Amsterdam
Lines: 27
Message-ID: <6pn02g$frq$1@star.cs.vu.nl>
References: <6pmncl$pph$1 AT osprey DOT global DOT co DOT za>
NNTP-Posting-Host: sloep05.cs.vu.nl
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


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