PDA

View Full Version : QTextStream No Proper ending



sujan.dasmahapatra
8th September 2010, 13:36
dear Friends
I have a QTextStream in which I am using for reading a file. I am writing Like this

while(!in.atEnd())
{
in >> var1 >> var2;
}

Now althugh its ending but it collecting the values 0 0 as the last value in the file, in the file there is no 0 ,0 values...I think its not recognizing the proper ending of the file.
Any suggestions would be highly appreciated. Thanks sujan

Dan Milburn
8th September 2010, 21:40
Can you give a complete example, including the input which causes this problem?

wysota
8th September 2010, 23:28
It is recognizing the end of the file but probably "var1" and "var2" are incompatible with the types of data read from the file (i.e. you might be reading text and trying to store it in integer variables).