Dont put ; after #define TMap std::map

here is my code:

FBullCowGame.h

#define TMap std::map

FBullCowGame.cpp


bool FBullCowGame::isIsogram(FString Word) const{
	if (Word.length() <= 1) return true;
	TMap<char, bool> LetterSeen;

	for (char Letter : Word) {
		Letter = tolower(Letter);
		if (LetterSeen[Letter]) {
			return false;
		}
		else
			LetterSeen[Letter] = true;
	}

	return true;
}

Buf if there is a ; after #define like this:

#define TMap std::map;

the compiler will complain about it:
%E5%9C%96%E7%89%87

Hope this infomation would helpful.

1 Like

Hello @Ricky_Chang,

cut and paste #define TMap std::map from your “FBullCowGame.h” to “FBullCowGame.cpp”. :wink:

Does it work now?

Cheers
Kevin

Thanks you

Privacy & Terms