From: mert0407 AT sable DOT ox DOT ac DOT uk (George Foot) Newsgroups: comp.os.msdos.djgpp Subject: Re: Help needed with command line params. Date: 8 May 1997 03:33:04 GMT Organization: Oxford University, England Lines: 50 Message-ID: <5krhhg$gk3@news.ox.ac.uk> References: <336E468C DOT 35 AT avanti DOT orient DOT uw DOT edu DOT pl> NNTP-Posting-Host: sable.ox.ac.uk To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Piotr Sieklucki (pas AT avanti DOT orient DOT uw DOT edu DOT pl) wrote: : Hello fellow DJGPPers, : I would like to ask for some advice. How do you read the command-line : parameters given to a program at runtime, and copy them to strings? : Basically, I want to get the 2nd and 4th (given that the 1st is the : full pathname to the program) parameters into strings <2nd> and <4th>. : I realise that this is bloody simple, but I just seem to be bloody : stupid. Anyone out there who can give me a helping hand, plz? TIA. The following example should help: #include /* for printf */ int main(int argc,char **argv) { int i; printf("You passed %d arguments.\n",argc-1); printf("\tProgram name:\t%s\n",argv[0]); for (i=1;i Merton College, Oxford