It supposed to read from a file and store in my class variable. But function ain't reading. Where is problem here ?
void GetGameInfo (const string fv, GetInfo G[], int & questionN)
{
string gameSection, gameDificulty;
int gameNumber;
ifstream fd(fv);
while(fd != 0)
{
fd >> gameSection >> gameDificulty >> gameNumber;
G[questionN].takeGame( gameSection, gameDificulty, gameNumber);
fd.ignore(100, '\n');
questionN++;
}
}
You should be reading like following
while ( fd >> gameSection >> gameDificulty >> gameNumber )
{
//...
}