Xref: news2.mv.net comp.os.msdos.djgpp:2509 From: Mike Newsgroups: comp.os.msdos.djgpp Subject: SIZEOF disparity...? Date: Sat, 6 Apr 1996 15:41:57 -0700 Organization: The University of Calgary Lines: 36 Message-ID: NNTP-Posting-Host: mbwarren AT acs5 DOT acs DOT ucalgary DOT ca Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp what am i doing wrong: with djgpp v2, when i take the sizeof this struct: typedef struct { char magic[2]; long size; int dummy; long offset; } header_t; it returns 16, when it should return 14 (2 chars = 2 + long (4) + int (4) + lont (4) = 2+4+4+4=14) (BTW, why are int's represented as 4 bytes on a PC? sizeof(int) returns 4...) i am using djgpp v2 on a 486-33 w/4megs ram... (if this is in the FAQ, sorry, but i can't use www/ftp; our DNS server is down...) ------------. mailto:mbwarren AT acs DOT ucalgary DOT ca .-------------- ..___ ___. | o _ | ? |"a smoking | \/ | | /\, (*) '\o__ o | section in a | i K E | | .(*)>(*)______'(*)\_____./'\.|\_________. | resturant is | | | | Gateway to the TEMPLE OF MIKE +---+ | like a peeing |__|\/|__| | `-.----------------------------------.--' | | section in a w a r r e n | | http://www.ucalgary.ca/~mbwarren +------+ | swimming pool" ------------' `----------------------------------' '\.____________