[Dev-C++] [Dev-C++]: Errors in structures
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Jeethu R. <je...@sa...> - 2001-07-03 03:51:10
|
Hi,
I've noticed this strange little Bug.I'm not certain weather its a bug or a
feature.
The size of this structure is actually 13 bytes.
But sizeof(header) says its 16.
struct tea_hdr
{
char jte[3];
unsigned char version;
DWORD infile_size;
DWORD infile_crc;
unsigned char fname_sz;
}header;
No, if I comment out the fname_sz member,
struct tea_hdr
{
char jte[3];
unsigned char version;
DWORD infile_size;
DWORD infile_crc;
//unsigned char fname_sz;
}header;
sizeof(header) returns 12.
Is the compiler trying to align structure on DWORD boundaries?
How do I get rid of this Bug/Feature ?
Thnx,
Jeethu Rao
|