   Reading bitmap data
  I''m trying to create my own structure to hold bitmap data.  I created the following:struct WindowsNativeFormatBitmapHeader {short identifier;unsigned long fileSize;unsigned int reserved;unsigned int headerSize;unsigned int width;unsigned int height;unsigned short planes;unsigned short bitsPerPixel;unsigned int compression;unsigned int dataSize;unsigned int horizontalResolution; //pixels per meterunsigned int verticalResolution; //pixels per meterunsigned int colors;unsigned int importantColors;};The problem is that when I try to read a bitmap into this structure, everything after the identifier does not get filled correctly.  Here is the code that I use:ifstream instream(filepath.c_str(), ios::in | ios::binary);memset(&header, 0, sizeof(header));instream.read((char *)&header, sizeof(header));//to check valuescout.write((char *)&header.identifier, 2);cout << header.fileSize;From the above code, the following is printed to the screen:BM14The file size is actually about 900000 bytes.I''ve been on this for a while now and I would really appreciate any help I can get, thanks!  
  Ack sorry about using the wrong tags for the code...since I can''t edit my last post for some reason, here it is again...properly formatted:I''m trying to create my own structure to hold bitmap data. I created the following: struct WindowsNativeFormatBitmapHeader {short identifier;unsigned long fileSize;unsigned int reserved;unsigned int headerSize;unsigned int width;unsigned int height;unsigned short planes;unsigned short bitsPerPixel;unsigned int compression;unsigned int dataSize;unsigned int horizontalResolution; //pixels per meterunsigned int verticalResolution; //pixels per meterunsigned int colors;unsigned int importantColors;}The problem is that when I try to read a bitmap into this structure, everything after the identifier does not get filled correctly.  Here is the code that I use: ifstream instream(filepath.c_str(), ios::in | ios::binary);memset(&header, 0, sizeof(header));instream.read((char *)&header, sizeof(header));//to check valuescout.write((char *)&header.identifier, 2);cout << header.fileSize;From the above code, the following is printed to the screen:BM14The file size is actually about 900000 bytes.I''ve been on this for a while now and I would really appreciate any help I can get, thanks!   