| morando (109) | ||||||
I open file like this:
Then in a loop i need to move cursor forward and break it if it is out of file range:
What function to use to check if seekg fails? Since with good() i got bad_alloc() exception. VS 2010
and it opens "mlock.c" file witch doesn't tell me much where is my mistake. Thank you for your time | ||||||
|
|
||||||
| toum (170) | |
|
A bad_alloc() exception has nothing to do with the errors flags of your stream. I think you should simply mesure the size of your file and make sure you don't seek at a position greater than the size. | |
|
|
|