Microsoft KB Archive/92762

From BetaArchive Wiki

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.

Additional reference words: kbinf 1.00 2.00 4.00

KBCategory: kbprg
KBSubcategory: CLngIss

Keywords : CLngIss kbprg
Version : 1.00 2.00 4.00
Platform : NT WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 22, 1997
©1997 Microsoft Corporation. All rights reserved. Legal Notices.