I have a enum with a bunch of different things. Is there a way to check to see if something is equal the enum.
EX:
If i am doing this wrong or there is a better way, please let me know thanks.Code:#include <iostream> using namespace std; enum myColor{RED, BLUE, GREEN}; int main() { string color; myColor test; cout << "Enter a Color: "; cin >> color; if (color == test) { cout << "The color you entered exist in my enum!\n"; } else { cout << "Does not exist :( \n"; } return 0; }