[edit] I meant to say “command arguments in compiler configs” . for the title.
I am trying to get into game mods. And I am trying to implement the source sdk. one of the steps is to go into debugging in my compiler configurations and add some data to the command arguments
-dev -sw -game "C:\Program Files (x86)\Steam\steamapps\SourceMods\firstmod"
Now I know what command arguments are. They are passed through the parameters of WinMain and judging by the name in the compiler configurations. I assume that has something to do with it. or maybe not. I am just not sure if the above would be considered 1 argument or multiple arguments. and what is it trying to achieve by passing a directory through. They weren’t too detailed with the information.
In a normal (read console) C/C++ application you would have program entry point with the following declaration:
Here
argcis the number of command line “strings”, including the command itself, whileargvis the array of these strings. So in your example it’d beargcof 5 (adding the program name), andargv[0]is the name of the program,argv[1]is"-dev", etc.Now under Windows a GUI application is different – the entry point is declared as:
So the whole command line (this time excluding the app name) is pointed to by
lpCmdLine, so it’d be one string as you put it above. There are helper functions to split that string though. Take a look at these two entries on MSDN:WinMainargv-style command line parameters