Microsoft KB Archive/92762

= Microsoft Knowledge Base =

Size and Alignment of Data Types Under Windows NT
Last reviewed: July 22, 1997

Article ID: Q92762

1.00 2.00 4.00 WINDOWS NT kbprg

The information in this article applies to:


 * Microsoft Visual C++ 32-bit Edition, versions 1.0, 2.0, and 4.0

SUMMARY
The table below shows the size and alignment (in bits) of various data types under Windows NT on an Intel system and a MIPS system.

MORE INFORMATION
Type-                 Intel/NT        MIPS/NT Specifier          size    align   size    align char (Sign/Unsign)   8 (S)   8       8 (U)   8 signed char          8       8       8       8 unsigned char        8       8       8       8

short               16      16      16      16 unsigned short      16      16      16      16

int                 32      32      32      32 unsigned int        32      32      32      32 long                32      32      32      32 unsigned long       32      32      32      32 void *              32      32      32      32 (*)               32      32      32      32 float                32      32      32      32

double              64      32      64      64 long double         64      32      64      64 NOTE: With 16-bit Microsoft development products, long doubles are 80-bits. With 32-bit Microsoft development products, long doubles are 64-bits, just as doubles are. There are two reasons that the long doubles are 64-bits:

- Portability. Windows NT runs on many processors, so portability of the OS

and Win32 applications is one of its main goals. All platforms except for intel provide 32-, 64-, and (sometimes) 128-bit floats. The intel 80-bit format is the exception. - Flexibility. We feel it is better to not support the long double as a new

type. At some point, it is possible that we will add the long double as a (more standard) 128-bit quantity. This is better than to support the long double as 80-bits in the short run and later change it to 128-bits.