command line arguments

The geek forum. PHP, Perl, HTML, hardware questions etc.. it's all in here. Got a techie question? We'll sort you out. Ask your questions or post a link to your own site here!

command line arguments

Postby juvey » 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.
[color="gray"]I cried out, "I'm slipping!" and your unfailing love, O Lord, supported me. When doubts filled my mind, your comfort gave me renewed hope and cheer. -Psalm 94:18-19[/color]
Image Image Image
User avatar
juvey
 
Posts: 29
Joined: Thu Nov 11, 2004 3:23 pm
Location: Oregon

Postby blkmage » Sun Nov 14, 2004 2:06 pm

Code: Select all
cd <foldername>
to change directories.
User avatar
blkmage
 
Posts: 4529
Joined: Mon May 03, 2004 5:40 pm

Postby juvey » Sun Nov 14, 2004 3:30 pm

: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. :)
[color="gray"]I cried out, "I'm slipping!" and your unfailing love, O Lord, supported me. When doubts filled my mind, your comfort gave me renewed hope and cheer. -Psalm 94:18-19[/color]
Image Image Image
User avatar
juvey
 
Posts: 29
Joined: Thu Nov 11, 2004 3:23 pm
Location: Oregon


Return to Computing and Links

Who is online

Users browsing this forum: No registered users and 511 guests