Seekg doesn't seem to work when I achieve EOF in myFile.
ifstream myFile("/path/file");
for(int i; i < 10; i++){
myFile.seekg(0);
while(getline(myFile, line)){
doSomething
}
}
So now I open the input stream in each loop:
for(int i; i < 10; i++){
ifstream myFile("/path/file");
while(getline(myFile, line)){
doSomething
}
}
But I would rather like to position 0. How can I achieve this?
rluks source
share