J
J Wang
typedef struct {
unsigned short int type; /* Magic identifier
*/
unsigned int size; /* File size in bytes
*/
unsigned short int reserved1, reserved2;
unsigned int offset; /* Offset to image data, bytes
*/
} HEADER
when I use HEADER to define a struct header,
the sizeof(HEADER) is 16. it should be 14, in my machine SunOS5.8.
and I check each member memory address in struct HEADER, there is a leap
between first member and second one, i.e.,
header.type is 0xffb887e0
header.size is 0xffb887e4.
I also check the sizeof(header.type) is 2
how to deal with it? I want to build the bitmap format. so the leap memory
should be useful. how to explain it?
many thanks
unsigned short int type; /* Magic identifier
*/
unsigned int size; /* File size in bytes
*/
unsigned short int reserved1, reserved2;
unsigned int offset; /* Offset to image data, bytes
*/
} HEADER
when I use HEADER to define a struct header,
the sizeof(HEADER) is 16. it should be 14, in my machine SunOS5.8.
and I check each member memory address in struct HEADER, there is a leap
between first member and second one, i.e.,
header.type is 0xffb887e0
header.size is 0xffb887e4.
I also check the sizeof(header.type) is 2
how to deal with it? I want to build the bitmap format. so the leap memory
should be useful. how to explain it?
many thanks