Weird error

the error pops up whenever i type a single letter as input. in the beginning it even popped up on typing a random word

Where is your code?

Please look if you try to call upon non existing letters. If you try to ask for the 3rd letter of your Guess “F” you will get this error message.

which code are you looking for? the one in main.cpp or FBullCowGame.cpp?

my word is “planet”. i tried guessing oiurf, it didn’t give me an error. but when i tried o, it gave me that error again.

Need to see the code that generates the error, your code, not the Windows system code of course. :wink:

actually, that error is meant to be there an Ben also got it in lecture 39. but in lecture 40, while checking for wrong length in CheckGuessValidity, i am getting this error now-

Severity Code Description Project File Line Suppression State
Error C3867 ‘std::basic_string<char,std::char_traits,std::allocator>::length’: non-standard syntax; use ‘&’ to create a pointer to member bullcowgame c:\users\anant\documents\unreal projects\section02\bullcowgame\bullcowgame\fbullcowgame.cpp 40

Try parens after length:

... else if ( Guess.length() != HiddenWord.length() ) ...

You are trying to access a property instead of using a method…

yep, that’s he error :stuck_out_tongue:
thanks again

Not a problem. Easily made error and happens all the time. :slight_smile:

How did you fix this error? I am getting it now and can not even compile my code.

Read the thread…

Privacy & Terms