Discussion: Const in the .h file

Ben has asked the question “Are any of the other functions we’ve written so far candidates for use of const? If so please suggest which (if any) in the discussion.”

I don’t think that any of the 3 Ben has highlighted should be considered a const. Ben told us that a const is “a value i promise not to change” The values of GetCurrentTry, IsGameWon, CheckGuessValidity should be variable not constant. So i would say only GetMaxTries should be a constant so far. I personally have not added any additional declarations that would be considered constant. has anyone else added additional declarations that could be considered constant? Dose anyone else agree or disagree ? Why?

1 Like

Privacy & Terms