I need to do something like this:
ifstream infile(Filename.c_str());
//ifstream infile(Filename.c_str(), ios::binary);
string line;
///////////// Read Header ////////////
//read magic number
getline(infine, line);
while(line[0] == "#")
getline(infile, line);
MagicNumber_ = line;
//more ascii stuff ......
//start reading binary data
int m;
infile.read(reinterpret_cast < char * > (&m), sizeof(m));
Can I do the above (ie. read with getline() and then read binary? Also, that will read 1 byte (8 bits) into an int (is there an easier way?). How would I read 12 bits at a time (for a 12-bit color image)?
Thanks!
David