| Start |
| int Denotes a signed integer type with "the natural size suggested by the
architecture of the execution environment", whose range includes at least -32767 to +32767, inclusive. Can be combined with unsigned, short, long, and long long (q.v.) in order to yield other integer types. |
| bool An integer type whose value can be either true or false. |
| char An integer type which is "large enough to store any member of the implementation’s basic
character set". It is implementation-defined whether char is signed (and has a range of at least -127 to +127, inclusive) or unsigned (and has a range of at least 0 to 255, inclusive). |
| char16_t An unsigned integer type with the same size and alignment as uint_least16_t, which is therefore large enough to hold a UTF-16 code unit. |
| char32_t An unsigned integer type with the same size and alignment as uint_least32_t, which is therefore large enough to hold a UTF-32 code unit. |
| float A floating point type. Has the narrowest range out of the three floating point types in C++. |
| double A floating point type. Its range includes that of float. When combined with long, denotes the long double floating point type, whose range includes that of double. |
| long Denotes a signed integer type that is at least as long as int, and whose range includes at least -2147483647 to +2147483647, inclusive (that is, -(2^31 - 1) to +(2^31 - 1)). This type can also be written as long int. The combination long double denotes a floating point type, which has the widest range out of the three floating point types. When the long specifier occurs twice, as in long long, it denotes a signed integer type that is at least as long as long, and whose range includes at least -9223372036854775807 to +9223372036854775807, inclusive (that is, -(2^63 - 1) to +(2^63 - 1)). |
| short Denotes a signed integer type that is at least as long as char, and whose range includes at least -32767 to +32767, inclusive. This type can also be written as short int. |
| void An incomplete type; it is not possible for an object to have type void, nor are there arrays of void or references to void. It is used as the return type of functions that do not return anything. Moreover, a function may redundantly be declared with a single parameter of type void; this is equivalent to declaring a function with no parameters (e.g. int main() and int main(void) declare the same function). This syntax is allowed for compatibility with C (where function declarations have a different meaning than in C++). The type void* ("pointer to void") has the property that any object pointer can be converted to it and back and result in the same pointer. This feature makes the type void* suitable for certain kinds of (type-unsafe) type-erasing interfaces, for example for generic contexts in C-style APIs (e.g. qsort, pthread_create). Any expression may be converted to an expression of type void; this is called a discarded-value expression: This may be useful to signal explicitly that the value of an expression is not of interest and that the expression is to be evaluated for its side effects only. |
| wchar_t An integer type large enough to represent all characters of the largest supported extended character set, also known as the wide-character set. (It is not portable to make the assumption that wchar_t uses any particular encoding, such as UTF-16.) It is normally used when you need to store characters over ASCII 255 , as it has a greater size than the character type char. |