M.Sc. Operational Research — C Programming Course


Command-line arguments

There are two ways to give command-line arguments to your Visual C++ program:

  1. Click on the Start button, and choose ProgramsCommand Prompt. You will need to cd to the directory containing your executable program, then enter the program name followed by the arguments (space separated), and press Return.

  2. Choose ProjectSettings..., select Debug, and enter the arguments in the Program arguments: field, then click on OK.

    These arguments will be given when executing the program from within Visual C++.

The second method is probably more convenient, but the first is probably more flexible.


Updated: 2006-Mar-04 21:02 GMT
Maintained by Steven Simpson