PDA

View Full Version : Command-Line Switches



liveapple2000
04-13-2002, 03:33 PM
I learned C++ and I am very interested in learning how to create command-line switches for my applications so that I can have extra features in them. What would be the starting point for the application? I have Microsoft Visual C++ 6.0 Enterprise. Thank you.

Shiro
04-14-2002, 03:13 AM
You can pass arguments on the command-line to your program



int main (int argc, char **argv)
{
int retval;

return retval;
}


Variable argc is the number of parameters on the command-line. This value is at least 1, since the name of the program is the first parameter. The variable argv points to the list of arguments.

>I have Microsoft Visual C++ 6.0 Enterprise.

And that's running under DOS?