c++ - Function reading file -
c++ - Function reading file -
it supposed read file , store in class variable. function ain't reading. 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 reading next
while ( fd >> gamesection >> gamedificulty >> gamenumber ) { //... }
c++ ifstream
Comments
Post a Comment