command line arguments
PostPosted: Sun Nov 14, 2004 12:43 pm
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.
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.