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

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

ubuntu - Bash Script to Check That Files Are Being Created -