From: tom burgess Newsgroups: comp.os.msdos.djgpp Subject: Re: Problem with integer declaration? Date: Sun, 03 May 1998 02:26:38 -0700 Organization: BCTEL Advanced Communications Lines: 16 Message-ID: <354C384E.6F40@drao.nrc.ca> References: <354AB827 DOT 8EE19C9D AT mailexcite DOT com> NNTP-Posting-Host: pntn02m03-192.bctel.ca Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk The problem is that the default alignment for structure members is 32 bits for efficiency. Shorts get padded to 32 bits, hence you have 4 extra bytes because you have 2 shorts in your struct. The "packed" attribute should prevent this, but at the moment I don't recall the correct usage. Try djgpp info. I seem to recall that there may be a bug with "packed" - you could check the delorie archives to get the details. regards, tom WT wrote: > > I am trying to write a short program to detect VESA VBE and output > information about the video card. I declared a struct of 512 bytes to be > used as a buffer for vbe_info_block. The strange thing is that when I > printed sizeof(vbe_info_block) it gave me 516 bytes instead of 512.