I want to debug a program in Visual Studio 2010 SP1 with an argument like: "file-%04d.jpg".
But entering this string in Project Properties > Config Properties > Debugging > Command Arguments changes the "%04", resulting in argv[1]
being set to: "file-[some unknown symbol]d.jpg".
The percent character seems to be interpreted as an escape sequence which is not what I want. This does not happen in 2008.
To set command-line arguments in Visual Studio, right click on the project name, then go to Properties. In the Properties Pane, go to "Debugging", and in this pane is a line for "Command-line arguments." Add the values you would like to use on this line. They will be passed to the program via the argv array.
To activate the debugger at the command prompt In the Session List window, do one of the following: Choose Debug Next. The debugger is now active and is waiting to attach to a session. Select a session, and then choose Debug.
Properties of Command Line Arguments: They are parameters/arguments supplied to the program when it is invoked. They are used to control program from outside instead of hard coding those values inside the code.
%xx seems to be interpreted as an ascii escape. So %25 should result in a real % character in the argument list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With