I'm making a text game, and want my options to have a common definer. Which works. But I want std::cin >> choice;
to always be lowercase so that an uppercase misspell doesn't matter for the player. Can't find any answers.
cpp file:
std::cout << std::endl << "Choise:";
std::cin >> choice;
if (dLookAround)
{
std::cout << "ede" << std::endl; //just a test
}
headerfile:
private:
std::string choice;
#define dLookAround \
(choice == "Look around"\
|| choice == "What do i see?"\
|| choice == "What do i see"\
|| choice == "Explore"\
|| choice == "Scout")
In this state, the code works. But I want cin
to read choice in lowercase so that I don't need to write every single word with uppercase and lowercase in the #define
all the time.