Copy x characters from a file to a c++ string?

rozick1 (60)
I want to copy 15 characters at a time from a file into a c++ string until the eof is reached (if the last read is less than 15 then I want those too). None of the methods in ifstream looked appropriate ( I don't want any delimiter).

What's the best way of doing this?

Thanks!
Moschops (5961)
You can use fread to read exactly 15 bytes. http://www.cplusplus.com/reference/clibrary/cstdio/fread/
Registered users can post here. Sign in or register to post.