From: Erik Max Francis Newsgroups: comp.os.msdos.djgpp Subject: Re: Date: Sat, 30 Nov 1996 20:19:19 -0800 Organization: Alcyone Systems Lines: 31 Message-ID: <32A10747.7BCE5721@alcyone.com> References: <19961128 DOT 160923 DOT 4455 DOT 7 DOT chambersb AT juno DOT com> <329D0008 DOT 4057 AT gbrmpa DOT gov DOT au> NNTP-Posting-Host: newton.alcyone.com 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 Leath Muller wrote: > Benjamin D Chambers wrote: > > > I just wanted to check: > > What are the bit-sizes of data types in DJGPP? > > As in, which is 8-bit, 16-bit, and 32-bit types? > > I thought int was 16-bit, but now I'm not so sure... > > char = 8 bits > short int = 16 bit (I think, I use asm a lot... :) > int = 32 bit > (void *), (char *) etc = 32 bit As the ANSI C advocate on this newsgroup :-), I'd like to point out that the sizes of these fundamental datatypes are implementation dependent. You're guaranteed that a char is a "byte," the smallest addressable size on your machine (for most modern machines this is 8 bits, but this is not required by ANSI C); you're guaranteed that sizeof(char) <= sizeof(short) <= sizeof(int) <= sizeof(long), and you're guaranteed that any pointer (including function pointers) are castable to void * and back without dataloss, but that's about it. (There, I've said my piece. :-) -- Erik Max Francis | max AT alcyone DOT com Alcyone Systems | http://www.alcyone.com/max/ San Jose, California | 37 20 07 N 121 53 38 W &tSftDotIotE | R^4: the 4th R is respect "But since when can wounded eyes see | If we weren't who we were"