Hi, I'm trying to write a class that will use ifstream to first extract a file's header into a char array, but then I want certain sections of that char array copied into a C++-style string (that is, the string class). Here's the code I have so far:
ifstream TheFile;
TheFile.open(OpenFileName,ios::in | ios::binary | ios::_Nocreate);
char *buffer = new char[512];
TheFile.read(buffer,512);
string Temp;
I would like to copy 4 characters from buffer[] starting at offset 0x100. How would I do this?
Thanks.