I'm kinda new to development using visual studio. I have a c++ program and I want to specify command line arguments to it from visual studio.

Can anyone please tell me how to do it?


(The version I'm using is visual studio 2005)

Recommended Answers

All 4 Replies

On the main IDE window's menu bar choose Project -> {project name} Properties. That opens the project's property pages. You can specify command line arguments under Configuration Properties -> Debugging -> Command Arguments. Just type in exactly what you would type at the command line after the program name.

If Edward wants the command line to look like this:

edsprogram.exe -I foo -U "bar baz"

Ed would put this in the command arguments field:

-I foo -U "bar baz"

Thanks for the quick reply ....

Suppose we have commands like this

C:test.exe -agr1 -agr2

and then after that again , I mean to say for agr3 and agr4 to work we have to set the agr1 and agr2 the how can we do this in visual studio settings in the command argument section....

c:test.exe -agr3 -agr4

please reply,

thanks in advance..

Well, i know its and old thread, but anyway.
If i just want to compile and link a c++ source file so i can get an exe file
i type :

cl nameOfThefile.cpp

or using the exception handler

cl /EHsc nameOfThefile.cpp

You can find more in the msdn help file

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.