Message-ID: <32E4505B.7ED0@post.comstar.ru> Date: Mon, 20 Jan 1997 21:12:59 -0800 From: Dim Zegebart Reply-To: zager AT post DOT comstar DOT ru Organization: zager AT post DOT comstar DOT ru MIME-Version: 1.0 To: DJGPP Mail List Subject: Bug in DJGPP or some my Error? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, Try this code. Here i declare some struct with members of unsigned char and unsigned int. I think what sizeof(unsigned int)+sizeof(unsigned char)=5, but I'm wrong! :-( DGJPP think another way: #include #include #define BFLAG unsigned char //I think sizeof(BFLAG) - 1 byte #define HND unsigned int //I think sizeof(HND) - 4 byte typedef struct { BFLAG nCode; HND hItem; } TItem; void main (void); void main(void) { TItem pItem; clrscr(); printf ("Size of BFLAG : %d\n",sizeof(BFLAG)); // 1 printf ("Size of HND : %d\n",sizeof(HND)); // 4 printf ("Size of TItem : %d\n",sizeof(TItem)); // 8 } What i missing ? Is it another trick of memory alligment ? -- Regards, Dim Zegebart, Moscow Russia.