Strange error

I followed what Ben did but still ended up with this error

 FBullCowGame::FBullCowGame(){	Reset();}

    int32 FBullCowGame::GetMaxTries() const{	return MyMaxTries;}

    int32 FBullCowGame::GetCurrentTry() const{	return MyCurrentTry;}
     
    int32 FBullCowGame::GetHiddenWordLength() const{	return MyHiddenWord.length; }

    void FBullCowGame::Reset() 
    { 
    	constexpr int32 MAX_TRIES = 8;
    	const FString HIDDEN_WORD = "ant";
    	
    	MyMaxTries = MAX_TRIES;
    	MyHiddenWord = HIDDEN_WORD;
    	MyCurrentTry = 1;
    	return; 
    }

THESE ARE THE ERRORS:

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

Severity Code Description Project File Line Suppression State
Error C2440 ‘return’: cannot convert from ‘unsigned int (__thiscall std::basic_string<char,std::char_traits,std::allocator>::* )(void) noexcept const’ to ‘int32’ BullCowGame

you’re missing the (). return MyHiddenWord.length();

1 Like

Privacy & Terms