WinMain Command Line String
Hi!
I am trying to set up my game to where if you run the executable with "+windowed", it''ll go windowed... like the quake series do. But when I try testing it it doesn''t work.
if( COMMANDSTRING = "+windowed")
{
fullscreen=false;
}
What''s wrong with this peice of code? Any help will be greatly appreciated. Thanks!
Justin Eslinger
~-=-=-=-=-=-=~~Justin Eslinger~~.."BlackScar"..~~-=-=-=-=-=-=~
Two possible solutions....
if (COMMANDSTRING == "+windowed") //see the double equals?
or
if (strcmp(COMMANDSTRING, "+windowed")) //strcmp compares strings
in the first that will only work if COMMANDSTRING is a string type class with an overloaded == operator. If not, the second one is the probable solution.
-Omalacon
if (COMMANDSTRING == "+windowed") //see the double equals?
or
if (strcmp(COMMANDSTRING, "+windowed")) //strcmp compares strings
in the first that will only work if COMMANDSTRING is a string type class with an overloaded == operator. If not, the second one is the probable solution.
-Omalacon
Ahh, thanks!
I knew about the ==, but it didn''t work the first time so I tried one =. I found the problem, though. You have to put a ! infront of it. Now everything works properly. Thanks alot!
Justin Eslinger
I knew about the ==, but it didn''t work the first time so I tried one =. I found the problem, though. You have to put a ! infront of it. Now everything works properly. Thanks alot!
Justin Eslinger
~-=-=-=-=-=-=~~Justin Eslinger~~.."BlackScar"..~~-=-=-=-=-=-=~
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement