Reading char arrays from a binary file
Nothing I have tried works...Unfortunately the tutorials on the net are not any help. They just give you a few lines of code without hardly any expianation. And none tell you how to read in a character array.
This is what I am trying to read in:
"Iron Dagger"
using:
Code:
char* name;
in.read(name, sizeof(name));
std::string newname(name);
Reads only to the first white space encountered
using:
Code:
char* name;
in.getline(name, sizeof(name), '\n');
std::string newname(name);
Reads the entire file in one lump...or so I think...it just outputs a bunch of crap.
anyone have any suggestions.