'How to read whitespace for ifstream with >> operator?

int main()
{
    {
        ifstream inputFile;
        // 1. Open the file
        inputFile.open(txt);

        // 2. Do something ( While file is not end of the line and it's opened)

        while (inputFile.is_open() && !inputFile.eof())
        {
            inputFile >> creatureTxt;
            LoadCreature(creatureTxt);
        }

        // 3. Close the file
        inputFile.close();
    }
}

Trying to save onto creatureTxt while emptySpace being counted. However, it seems like it's ignoring the emptySpace. I'm trying to avoid using getline().



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source