Why doesn't ifstream read to the end?
Posted
by user146780
on Stack Overflow
See other posts from Stack Overflow
or by user146780
Published on 2010-04-25T03:14:31Z
Indexed on
2010/04/25
3:23 UTC
Read the original article
Hit count: 305
I'm making a notepad-like program. To get the text from a file I read each character into the buffer by doing
while (!file.EOF())
{
mystr += file.get();
}
however if I load in an exe it stops after MZ but Notepad reads the whole exe. I set my ifstream to binary mode but still no luck. What am I doing wrong? Thanks
© Stack Overflow or respective owner