What could be made "const"

Let’s look through our other member functions (excluding getters).

Reset() - a function that we will probably use to restore all member variables back to their starting values, so this absolutely can not be declare as a “const”.

IsGameWon() - a function that will check if we won the game. Does it have to change anything? Probably not. We may declare it as a “const”.

CheckGuessValidity() - a function that is going to check various things like is the guess an isogram, are all characters valid and many other things. Seems harmless right? BUT it will UPDATE the private member for the current try. Therefore, this function also can not be declared as a “const”.

Alright here are my thoughts. Hopefully I got this right :smiley:

Privacy & Terms