Sign in to follow this  

Using argv[] with Windows

This topic is 3935 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
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

This topic is 3935 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this