mercredi 23 août 2017

C++ String if statements not working - Yes - I think this isnt a duplicate

Uhh hey guys, im back again. I'm on a diff project (my other one is finished.) Soo yeah. My if statement isnt detecting correctly - please help me.

    void takeInput()
    {
     cin >> currentInput;
     if (currentInput == "begin") {
        inMenu = false;
        currentInput = "NULL";
     }
     if (currentInput == "leave") {
        inMenu = true;
        currentInput = "NULL";
     }
    }

YES - I know literally setting current input to null won't actually set it to null, but im too lazy to \0.

Aucun commentaire:

Enregistrer un commentaire