• ### Popular Now

• 10
• 12
• 12
• 14
• 15
• entries
122
121
• views
68722

94 views

Well, so far so good. I've managed to make it "see" the 's' in the first line of the file, and then act to take in the number just after it. The code I have so far is below; still has mainly debugging cout statements, but at least I'm gettimg somewhere.

        void LoadGame() // Still implementing        {            ifstream gameIn(file.c_str());            string line, prev;            do            {                gameIn >> line;                prev = line;                for (int i = 0; i < line.length(); i++)                {                    cout << line;                    if (line == 's')                    {                        i++;                        cout << ": S will have ";                        for (int it = i; line[it] != '!'; it++)                        {                            cout << line[it];                            i++;                        }                        cout << " object." << endl;                    }                    break;                }                break;                cout << line << endl;            } while (!gameIn.eof() && line != prev);            gameIn.close();        }

There are no comments to display.