The C language contains five basic data types:Void,Integer,Float,Double, AndChar.
| Type |
Description |
| Void |
Null type |
| Int |
Integer |
| Float |
Floating Point Type |
| Double |
Double Precision Floating Point Type |
| Char |
Character Type |
C ++ defines two other basic data types:BoolAndWchar_t.
| Type |
Description |
| Bool |
Boolean Type; Value: true or false |
| Wchar_t |
Wide character type |
Type Modifier
some basic data types can be signed , unsigned , short , and long . when the type modifier is used separately, the default type is int . the following table lists all possible data types:
| Bool |
| Char |
| Unsigned char |
| Signed Char |
| Int |
| Unsigned int |
| Signed int |
| Short int |
| Unsigned short int |
| Signed short int |
| Long int |
| Signed long int |
| Unsigned long int |
| Float |
| Double |
| Long double |
| Wchar_t |
Type and value range
the size of the basic data type and the data range that can be expressed are related to the compiler and hardware platform. "cfloat" (or "float. H ") header files often define the maximum and minimum values of the data that can be expressed by the basic data type. you can also use sizeof to obtain the type size (number of bytes ). however, many platforms use standard data types, such. int and float usually occupy 32 bits, and char occupies 8 bits, double usually occupies 64 bits. bools is usually implemented in 8 bits.