首页 > 代码库 > C++ notes for beginners(2)

C++ notes for beginners(2)

Primitive Built-in Types

TypeImplicationMinimum  storage space
boolbooleanNA
charcharacter8 bits
wchar_twide character16 bits
shortshort integer16 bits
intinteger16 bits
longlong integer32 bits
floatsingle-precision floating-point6 significant digits
doubledouble-precision floating-point10 significant digits
long doubleextended-precision floating-point10 significant digits

 

 

 

 

 

 

 

 

 

Integral types (except the boolean type) may be either signed or unsigned

Unlike other integral types, there are three distict types for char:

plain char equals to char

signed char

unsigned char

 

C++ notes for beginners(2)