Been having problems with my code at this point... stuck for 3 days!

I asked a question on the Q&A of this lecture a couple days ago and a couple people have been trying to help me but it’s quite slow and I’m trying speed it up so posted here.

in the if statment in the challenge i have what the instructor put but i get the error

" the object has type qualifiers that are not compatible with the member function "FBullCowGame::GetHiddenWordLength" "

and

" Error C2662 'int32 FBullCowGame::GetHiddenWordLength(void)': cannot convert 'this' pointer from 'const FBullCowGame' to 'FBullCowGame &' "

i dont know what to do i tried changing it to HiddenWord.length() but i got similiar errors and either way it wont compile.

Some one pointed out that it thinks that HiddenWord and GetHiddenWordLength are const and therefore can’t be compared to the int32 value Guess.length() however i have said that at no point are either of those declared as const as the only things that are const in my code are CheckGuessValidity and GetMaxTries and GetCurrentTry are the only class methods (if that what you call the things you declare in the header and then define in the class’s .cpp file) that are passed as const.

my GetHiddenWordLength() definition literally only consists of " int32 FBullCowGame::GetHiddenWordLength() { return HiddenWord.length() } " which shows it to be int32 so i dont know why it says its a const

my entire code can be found here: https://gist.github.com/anonymous/2e733b210353591759fde0323bee325d

Thanks anyone who tries to help me

At the gist you haven’t included your header file. Also, you can add multiple files to a single gist which would be easier to read.

Privacy & Terms