"Constructor" "const" relationship question

At 1:13, he says “whenever you write a constructor in the future, I want you to write the word cost after it”. At this point the code within the FBullCowGame.h looks like this (ignoring comments):

I’m confused. As far as I understand, the FBullCowGame() is the constructor and the “getters” below that are simply member functions we have labeled as “const” so that they cannot modify or alter stuff. But from the instructions to write “const” after constructors, I have this backwards? Is GetMaxTries a constructor? Any help clarifying this would be appreciated!

No, you have it right. FBullCowGame() is the constructor. At this point in the course they haven’t talked about constructors so don’t give too much thought as to why the constructor has or doesnt have the const keyword.

Privacy & Terms