Re: unexpected eof
- From: "Yong Hu" <yhu221300@xxxxxxxxx>
- Date: 2 Jul 2006 17:11:08 -0700
Alan wrote:
Dear All,
I'm trying to write a C++ that reads in hexadecimal characters from a
text file. For this I use the >> to read in a character at a time
inside a while loop that waits for eof to be reached. I'm able to read
in correctly about half my text file, then the program breaks out of
the while loop.
I presume this is due to the fact that one of the hex characters that
I'm trying to read in, is equals to eof. I've tried to get around this
problem, by using file pointers to determine the size of the file and
then use a for loop to read in the corresponding amount of characters.
This doing, I can copy half the initial text file into another file,
with the rest being filled with rubbish.
Does anyone have any ideas how I could get around this problem?
Thanks in advance for your help,
Regards,
Alan
Hi, Alan,
You have asked the same question in so many forums. Stop doing that
way!
.
- References:
- unexpected eof
- From: Alan
- unexpected eof
- Prev by Date: Re: Problem with VS and memcpy...
- Next by Date: how to connect to a database ?
- Previous by thread: Re: unexpected eof
- Next by thread: Re: Replace a locked Dll
- Index(es):
Relevant Pages
|
|