greetings;
i get this error when i compile, how do i correct it? C:\Program Files\Microsoft Visual Studio\MyProjects\enum\enum.cpp(11) : error C2676: binary '++' : 'enum game_result' does not define this operator or a conversion to a type acceptable to the predefined operator
here is my code;
Code:#include <iostream> using namespace std; enum game_result {win, lose, tie, cancel}; main() { game_result result; enum game_result omit = cancel; for (result = win; result <= cancel; result++) { if (result == omit) cout << "The game was cancelled\n"; else { cout << "The game was played "; if (result == win) cout << "and we won!"; if (result == lose) cout << "and we lost."; cout << "\n"; } } return 0; }