I have a bitmap image that I am parsing and I need to be able to open the file and store the first unsigned short.
I tried to accomplish this using FILE and fscanf() but fscanf() always fails and returns 0 (number of items successfully read).
FILE *pFile = fopen ( fileName->c_str() , "r" );
if ( pFile == NULL )
{
cerr << "couldn't open file ; exiting..." << endl;
exit(0);
}
unsigned short seed;
fscanf (pFile, "%hu", &seed);
Does anyone know of another approach I could take (possibly ifstream?) or maybe could just give me some pointers? Any help would be greatly appreciated.
Thank you.