Hi,
I have a text file that looks like this:
0 169 26
1 172 27
2 172 27
0 134 15
1 134 15
2 134 15
0 219 18
And I'm reading it with very simple loop
HitsIn.open(HitsFile);
while (!HitsIn.eof()) {
HitsIn >> DetectorNo >> Row >> Column;
// do something with these data
}
The problem is that the program reads the last line in the file always twice. I don't see any reason why it does this. Maybe I shouldn't use .eof(), but I don't know what to use instead. Could somebody help me please?
Thanks, Hedvika.
I have a text file that looks like this:
0 169 26
1 172 27
2 172 27
0 134 15
1 134 15
2 134 15
0 219 18
And I'm reading it with very simple loop
HitsIn.open(HitsFile);
while (!HitsIn.eof()) {
HitsIn >> DetectorNo >> Row >> Column;
// do something with these data
}
The problem is that the program reads the last line in the file always twice. I don't see any reason why it does this. Maybe I shouldn't use .eof(), but I don't know what to use instead. Could somebody help me please?
Thanks, Hedvika.