d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Quick Question > -
Add Reply New Topic New Poll
Member
Posts: 8,732
Joined: Nov 21 2007
Gold: 775.00
Oct 16 2013 07:11pm
C programming, using PuTTY

I have compiled a program, now I'm trying to run it passing through 2 files as arguments

Except I don't actually know how to do it

./safeStr testfilea testfileb

^When I use that, my program returns the nargs != 2 error message

./safeStr <testfilea> <testfileb>

^When I use that, my program returns: Missing name for redirect




Any help? Thanks a ton
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Oct 16 2013 07:45pm
have your program print out the arguments to see what your program sees.

i suspect the first argument might be the program name, so size == 3
Member
Posts: 237
Joined: Aug 6 2011
Gold: 6,026.00
Oct 18 2013 02:48pm
First way to write in the arguments is the right one. As carteblanche said, the first arg is always the executable image path, so...
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll