Page 1 of 1

command line arguments

PostPosted: Sun Nov 14, 2004 12:43 pm
by juvey
Hi all. I'm doing an assignment in which we're using C, writing a program that will use quick sort for whatever, floats, ints, short, double, the like. Anyway, we're supposed to use the command box thing to start the program, passing in the filename and type to be sorted as such:

program.exe filename -type

I realize that these are stored in the argv array. But what I can't figure out is how to get to the directory where my program is stored so that it will run it. I bring up the command box, type dir, and then I don't know what to do to move through the files. Could someone help? Thanks.

PostPosted: Sun Nov 14, 2004 2:06 pm
by blkmage
Code: Select all
cd <foldername>
to change directories.

PostPosted: Sun Nov 14, 2004 3:30 pm
by juvey
:D Thanks. I was just coming back here to say that a friend had helped me figure it out, so the thread could be closed if mods like. :)