Cna't figure out how the C++ Map container is populated in the IsIsogram()?

'm totally confused with the IsIsogram function of Section 2, Lecture 48, how did the hidden word get placed into the TMap variable LetterSeen?

Below, I commented the code in how I think it works

bool FBullCowGame::IsIsogram(FString Word) const
{
if (Word.length() <= 1 ) // If the number of characters are 1 or
return true; // less return true because it’s an IsIsogram.

TMap<char, bool> LetterSeen; //Create an empty map called LetterSeen,

for (auto Letter : Word)     // Take the characters in the string "Word
{                            // and place then in the string "Letter".

	Letter = tolower(Letter); //Convert the all the characters of "Letter" to lowercase.

	if (LetterSeen[Letter])   //HOW DOES LETTERSEEN GET POPULATED WITH CHARACTERS FROM "WORD"?
		return false;
	else
		LetterSeen[Letter] = true;
}	
return true;

}

Privacy & Terms