| delorie.com/archives/browse.cgi | search |
| From: | toudi <pienkny AT friko6 DOT onet DOT pl> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: annoying structure problem |
| Date: | Thu, 08 Jul 1999 23:16:28 +0200 |
| Organization: | beautiful piramids |
| Lines: | 27 |
| Sender: | pienkny AT pa243 DOT warszawa DOT ppp DOT tpnet DOT pl |
| Message-ID: | <3785152C.1BE3ED3F@friko6.onet.pl> |
| References: | <7m1u1e$pnu$1 AT rockall DOT cc DOT strath DOT ac DOT uk> |
| NNTP-Posting-Host: | pa243.warszawa.ppp.tpnet.pl |
| Mime-Version: | 1.0 |
| X-Trace: | news.onet.pl 931468493 4353 212.160.52.243 (8 Jul 1999 21:14:53 GMT) |
| X-Complaints-To: | abuse AT onet DOT pl |
| NNTP-Posting-Date: | 8 Jul 1999 21:14:53 GMT |
| X-Mailer: | Mozilla 4.05 [en] (Win95; I) |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
You are using 32bit compiler. Variables are rounded to multiply of 32bit.
for example:
byte, short, char - these variables are 4 bytes long in memory.
You can use something like that to produce correct struture in memory
(if you want to write or read from file)
typedef struct
{
unsigned short int bfType __attribute__ ((packed));
unsigned int bfSize __attribute__ ((packed));
unsigned short int bfReserved1 __attribute__ ((packed));
unsigned short int bfReserved2 __attribute__ ((packed));
unsigned int bfOffBits __attribute__ ((packed));
}BITMAPFILEHEADER;
--
mailto:pienkny AT friko6 DOT onet DOT pl
+4822368951
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |