Jump to content
  • Advertisement
Sign in to follow this  
EECSisnotgood

Using argv[] with Windows

This topic is 4121 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 am programming a monopoly game that I will eventually compile on Linux, so I know how to use the argv[] in int main that way when I call the program. However, I am not sure how to send it the information in Windows while using Microsoft Visual. My array has 6 elements, should I use run? Right now I just click on the .exe, and I don't know how to send it information without a command line. Hope this makes sense, thanks for the help.

Share this post


Link to post
Share on other sites
Advertisement
Alright a few possibilities of what you are talking about :

In a windows application, you can have a separate entrance point compared to a traditional C or C++ application. It's called WinMain and it passes in the parameters in a different way to int main(). Visual Studio supports both types of entrance types, so WinMain and main(), if you have main() it'll be the same as what you'd expect in linux.

In terms of how to set the command line in Visual Studio for debugging, rather than going to the command line, right click on the project you are interested in, go to Debug options area, then type in the command lines under the command line area. This will then run your application with those command line parameters.

Share this post


Link to post
Share on other sites
Create a text file and put lists of commands in it. Give it a .bat extension. When you click on it, Windows will run the commands!


rem this is a comment
prog param1 param2 param3

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!