Hello all, it has been a long, long, time. I have a certain problem in my main. This is just a Fixed-snippet but it gets the very general idea of it.
I am currently trying to get more then two commands e.x if (Command == "Stuff" || "Stuff") { ...code...}
The problem is it accepts it perfectly but does not execute currently. I'm not sure if I should try a switch statement or what. Thanks in Advance.
E.x
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
cin >> Command;
if (Command == "DoCode" || "docode") //Option 1 can be two different words
{
...
}
if (Command == "MoreCode" || "modecode")
{
... //Only executes fire statement.
}
It will execute the first if statement, but from there on, it will only execute it.
While I'm not sure if that is the general way of getting it. I've been using it as a menu-ish command;
You need to put every time the Command == part if (Command == "MoreCode" || Command == "modecode")
or better if ( function_that_returns_the_lowercase_of_the_passed_string ( Command ) == "morecode" )
( You'd have to write the function yourself but it's quite easy )