views:

62

answers:

2

i am using Visual studio 8. i pass command line argument to my program when i execute the program using exe file it works fine but when i use to debugg. it is unable to open the input file which i have given it in the form of command line argument. although i have given the command line argument in the Project->properties->debug->command line arguments....

e.g "program.exe" input_file output_file

input file contains data which i have to use in the calculation if i am unable to debug it. how can i remove the errors in my program

reply me thanks

A: 

You may need to specify the working directory on that same property page in order to have your debug executable run in the same directory as your input file. Right now it's probably not able to pass your file because it can't find it.

bshields
i have placed the input file in the same directory as well as the set the working directoryif it can not find the file while debugging it should not find it while normal execution may be i am wrong but still confusing
See Tobbe's response, you should not be putting the .exe name in the "Command Arguments" section if you are doing that.
bshields
i did not added exe file name in command line
+1  A: 

You should not include "program.exe" in the command line arguments.

Tobbe
i did not added exe file name in command line