ifstream

M

Michael Sgier

Hi
I read in a simple text without any line feeds etc. So simply "TEST"
But this code adds at the end, after TEST something. How can i avoid this?
Many thanks
Michael


std::ifstream InPutfile1;

InPutfile1.open(InFile, std::ios::in | std::ios::binary);
while(!InPutfile1.eof() && !InPutfile1.fail())
{
char NewByte;

Byte = InPutfile1.get();
 
R

red floyd

Michael said:
Hi
I read in a simple text without any line feeds etc. So simply "TEST"
But this code adds at the end, after TEST something. How can i avoid this?
Many thanks
Michael


std::ifstream InPutfile1;

InPutfile1.open(InFile, std::ios::in | std::ios::binary);
while(!InPutfile1.eof() && !InPutfile1.fail())
{
char NewByte;

Byte = InPutfile1.get();

I told you already.

Please see FAQ 15.5

http://www.parashift.com/c++-faq-lite/input-output.html#faq-15.5
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top