So my question is this...if condition is met, it will exit the inner while and will re-execute the outer while (because the flag is still false...when it enters the inner while, will it start the file again?
If not how do I say start from the beginning of the file?
1 2 3 4 5 6 7 8 9 10 11 12 13
bool flag = false;
while(!flag) {
... some code ...
while (!myfile.eof()) {
getline(myfile, inBuffer);
... compare some stuff ...
... if condition met -> flag = false & break
... if condition not met -> flag = true and it will exit both loops when done reading the file
}
}