I have a class that reads "blocks" from a binary file. I use it this way :
while(log.HasNextBlock()) {
block = log.GetNextBlock();
}
My problem is that i need to check inside of the function HasNextBlock() if i am at the end of the file, in which case i would return false. I'm tring to use feof() to check that, but i read i had to do a read operation before calling feof(), but in my case, the read operation is done in GetNextBlock(), i.e after the call to feof().
Is there a way to see if i am at the end of the binary file without doing an operation that would modify the "context" (i.e not change the current position in the file or whatever other variable) ?
Thanks for your help ! :)