views:

43

answers:

1

Hi,

I just installed Visual Studio C++ 2010 Express (BTW. great ide). I have to make simple application, but I will open it from command prompt, and I need using parameters. So my question is: how to using parameters in Visual C++ .NET 2010 Express? I need one string and some int. It's special creator to do this or I must change code (if yes - how?)?

Best regards

+3  A: 

To debug your program with command line arguments, use Project + Properties, Debugging, Command Arguments setting.

Click around some more to get familiar with what's there, you'll need it sooner or later. Press F1 if things sound mysterious.

Hans Passant
I add 'adres' in this input, but I don't see it in code. How to use this var?
asd
Check your favorite C or C++ programming book to learn how to use the argc and argv arguments passed to main().
Hans Passant
http://pastebin.com/dwqY2kjA this code was created. How add argc
asd
You do realize that this is not C++ code? Find the Main() method for a C++/CLI program in the .cpp file of your project. Its *args* argument is a string array of the command line arguments. I recommend a new question, properly tagged as [c++-cli] if you need more help.
Hans Passant
Also note that a GUI app like this rarely uses command line arguments. Maybe you just used the wrong project template. Use Win32 + Console Application to get the traditional one.
Hans Passant