Hi,

I wish to read an input file 5 times. I am able to read it once but when i try to read it second time i am unable to do that because the file pointer is stuck at EOF.
Can anyone suggest a small sample code of how to do that?

Thanks and Regards

Recommended Answers

All 3 Replies

fin.close( );
fin.clear( );
fin.open( "yourfile.txt);

Hope you have tried... SeekTobegin()

fin.seekp(ios::begin)
fin.clear();

>>Hope you have tried... SeekTobegin()
That is only for MFC CFile class. Not available to anything else.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.