jschmuff
asked on
I can only see 5 words in my list..
I can only see 5 words in my list file. Is there something wrong with the code?
void Game::listWords()
{
Game myGame;
myGame.loadFile();
cout << "\tThe following words in the file are: \n" << endl;
for(int Loop = 0; Loop < Count - 1; Loop++)
{
cout << "\t" << Words[Loop] << "\n";
if (++Loop > Count)
break;
cout << "\t" << Words[Loop] << "\n";
if (++Loop > Count)
break;
cout << "\t" << Words[Loop] << "\n";
if (++Loop > Count)
break;
cout << "\t" << Words[Loop] << "\n";
if (++Loop > Count)
break;
cout << "\t" << Words[Loop] << "\n";
}
}
void Game::listWords()
{
Game myGame;
myGame.loadFile();
cout << "\tThe following words in the file are: \n" << endl;
for(int Loop = 0; Loop < Count - 1; Loop++)
{
cout << "\t" << Words[Loop] << "\n";
if (++Loop > Count)
break;
cout << "\t" << Words[Loop] << "\n";
if (++Loop > Count)
break;
cout << "\t" << Words[Loop] << "\n";
if (++Loop > Count)
break;
cout << "\t" << Words[Loop] << "\n";
if (++Loop > Count)
break;
cout << "\t" << Words[Loop] << "\n";
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER