S
SpreadTooThin
How can I read in two characters from a file into a std::string?
the long way:
fstream f("myfile.bin", ios::binary | ios:in); // Opened for read
binary...
unsigned char buffer[3];
buffer[2] = '\0';
f.read(buffer, 2);
std::string x(buffer);
Got a better way?
the long way:
fstream f("myfile.bin", ios::binary | ios:in); // Opened for read
binary...
unsigned char buffer[3];
buffer[2] = '\0';
f.read(buffer, 2);
std::string x(buffer);
Got a better way?