I wrote the function that returns the next character from the QTextStream. There is:
QString peek(QTextStream *stream){
QString __str = '\0';
stream->seek(stream->pos() + 1);
__str = stream->read(1);
stream->seek(stream->pos() - 2);
stream->flush();
return __str;
}
For example, I have a file:
abcde
When I tried to brought into the function result on the screen, output was correctly: 'b'. But when I tried to output the next character and then the first character, like that:
/* Any function to output */(peek(file) + file->read(1));
Output was: "ca" instead "ba".
What's wrong?
Sorry, if it's stupid question and sorry for my bad english :)