c++ - Variable sizes
- IR (3/3) Oct 03 2004 With the Digital Mars compiler, how big (in bytes) are these variables?
- Heinz Saathoff (9/12) Oct 04 2004 depends on the memory model. In standard 32-bit windows the sizes are:
- Scott Michel (12/17) Oct 04 2004 int main(void)
With the Digital Mars compiler, how big (in bytes) are these variables? unsigned int, int, unsigned short, short, unsigned long, long, and char Thanks
Oct 03 2004
Hello, IR wrote...With the Digital Mars compiler, how big (in bytes) are these variables? unsigned int, int, unsigned short, short, unsigned long, long, and chardepends on the memory model. In standard 32-bit windows the sizes are: unsigned int and int : 32 bit unsigned short and short : 16 bit unsigned long and long : 32 bit unsigned char and char : 8 bit HTH, Heinz
Oct 04 2004
IR wrote:With the Digital Mars compiler, how big (in bytes) are these variables? unsigned int, int, unsigned short, short, unsigned long, long, and char Thanksint main(void) { printf("sizeof(unsigned int) = %d\n", sizeof(unsigned int)); printf("sizeof(int) = %d\n", sizeof(int)); printf("sizeof(unsigned short) = %d\n", sizeof(unsigned short)); printf("sizeof(short) = %d\n", sizeof(short)); printf("sizeof(unsigned long) = %d\n", sizeof(unsigned long)); printf("sizeof(long) = %d\n", sizeof(long)); printf("sizeof(char) = %d\n", sizeof(char)); return 0; }
Oct 04 2004