Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include the percent character in the visual studio debugger command line arguments?

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.

like image 909
jra3512 Avatar asked Oct 24 '11 21:10

jra3512


People also ask

How do I debug command-line arguments in Visual Studio?

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.

How do I debug CMD?

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.

What are command-line arguments C++?

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.


1 Answers

%xx seems to be interpreted as an ascii escape. So %25 should result in a real % character in the argument list.

like image 98
moushkka Avatar answered Oct 21 '22 20:10

moushkka