There is probably something I'm missing here

Hi again awesome community!

So maybe I’m missing something obvious, but I got the impression that you cannot have const keyword on functions that alter member variables, you also cannot have const in functions that call functions which are not altering member variables? So we cannot move the stuff that Mike showed on the video from ProcessGuess to a const function, since they are calling EndGame() which does alter a member variable (bGameOver)?

I’m a little confused now, and you are too probably, since I don’t know how to explain things, but any clarification would be great, thanks! :slight_smile:

The whole function can’t but the checking can so you’d end up with

if (IsGuessValid(Guess))
{
    // do stuff
}

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms