Getting the command line...
I'm writing a console app that has need of the command line.
I'm also using VS, so if anyone knows how to add a command line parameter to and app under VS, I would be most grateful to know how.
Thank you.
The command line arguments to a C/C++ program are passed via the argv parameter to main.
int main(int argc, char ** argv);
argc stores the number of arguments passed to main (including argv[0]) and argv is dereferenced to get the actual arguments.
int main(int argc, char ** argv);
argc stores the number of arguments passed to main (including argv[0]) and argv is dereferenced to get the actual arguments.
Or, if you want to know how to pass parameters as opposed to read them, right click your project and choose properties, from there goto debugging and enter your parameters into the 'command arguments' box.
Alan
Alan
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement