Mail Archives: djgpp/1996/12/01/01:53:29
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"
- Raw text -