c:c_data_types [C++ Reference]
Keywords: c,c_data_types
Date: 2009-04-26T00:39:26-0700

[[c:c_data_types]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- fr
- it
- jp
- pl
- ru
- tr

C++ fundamental (primitive) types:

- bool
- char
- int
- float
- double

Optionally:

- void

Additional qualifiers for the primitive types:

- signed
- unsigned
- short
- long

Using the two together:

bool: 1 byte (Range: true or false)

signed char = char: 1 byte, (Range: -128 to 127)

unsigned char: 1 byte (Range: 0 to 255)

short = short int = signed short int: 2 bytes (Range: -2^15 to 2^15-1)

unsigned short = unsigned short int: 2 bytes (Range: 0 to 2^16-1)

long = long int = signed long int = signed int = int: 4 bytes (Range: -2^31 to 2^31-1)

usigned long = unsigned long int = unsigned int: 4 bytes (Range: 0 to 2^32-1)

float: 4 bytes (Cannot be unsigned, short, long. Range: 3.4e-38 to 3.4e+38, 7 digits)

double: 8 bytes (Cannot be unsigned, short. Range: 1.7e-308 to 1.7e+308, 15 digits)

long double: 10 bytes (Range:)

For VC++, check MSDN: http://msdn.microsoft.com/en-us/library/s3f49ktz(VS.80).aspx

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •