Jump to content
  • Advertisement
Sign in to follow this  
ThoughtCriminal

Getting the command line...

This topic is 4831 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!