Message-ID: <001101c0f7a6$837b46a0$cf10a2cb@lunar> From: "Lunar" To: Subject: BIG problem with structure alignment! Date: Mon, 18 Jun 2001 10:22:27 +0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000D_01C0F7E0.92BD7A40" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Reply-To: djgpp AT delorie DOT com This is a multi-part message in MIME format. ------=_NextPart_000_000D_01C0F7E0.92BD7A40 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi you all, I've met this problem with structure declaration: I did have a struct like this: struct T1{ char _t1; short _t2; }; and the sizeof(T1) return a result of 4, instead of 3 as I expected. Why = is that? If it's because of some aligment option, then could you help me = turn them off? Please mail me at lunarorb AT hn DOT vnn DOT vn if you can help Thanks Lunar ------=_NextPart_000_000D_01C0F7E0.92BD7A40 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi you all,
I've met this problem with structure=20 declaration:
I did have a struct like = this:
struct T1{
  char  _t1;
  short _t2;
};
 
and the sizeof(T1) return a result of = 4, instead of=20 3 as I expected. Why is that? If it's because of some aligment option, = then=20 could you help me turn them off?
Please mail me at lunarorb AT hn DOT vnn DOT vn if you can=20 help
Thanks
Lunar
------=_NextPart_000_000D_01C0F7E0.92BD7A40--