What does this do: char(nextChar). I have no variable named char. Am I calling the char class constructor here or something?
int nextChar;
while ((nextChar == stream.get()) != EOF)
{
// Convert it to a string for lookup in the symbol table
string foundChar = "";
foundChar += char(nextChar);
}
It appends
char(nextChar)to thestd::stringfoundCharusing the overloadedstd::string::operator += (char)and then discards the string.char(nextChar)is a cast frominttochar(sincenextCharis declared asint) – equivalent to(char)nextChar.