Data type tell us that how much storage/memory to be allowed to a variable.
Types | Data Types |
---|---|
Basic data type | int,char,float,double |
Derived data type | Array,pointer,structure,union |
Enumeration data type | Enum |
Void data type | void |
Data Type | Memory Size | Range |
---|---|---|
Char | 1 byte | −128 to 127 |
signed char | 1 byte | −128 to 127 |
unsigned char | 1 byte | 0 to 255 |
short | 2 Byte | -32,768 to 32,767 |
signed short | 2 byte | -32,768 to 32,767 |
unsigned short | 2 byte | 0 to 65,535 |
int | 2 byte | −32,768 to 32,767 |
signed int | 2 byte | −32,768 to 32,767 |
unsigned int | 2 byte | 0 to 65,535 |
short int | 2 byte | −32,768 to 32,767 |
signed short int | 2 byte | −32,768 to 32,767 |
unsigned short int | 2 byte | 0 to 65,535 |
long int | 4 byte | -2,147,483,648 to 2,147,483,647 |
signed long int | 4 byte | -2,147,483,648 to 2,147,483,647 |
unsigned long int | 4 byte | 0 to 4,294,967,295 |
float | 4 byte | -2,147,483,648 to 2,147,483,647 |
double | 8 byte | -2,147,483,648 to 2,147,483,647 |
long double | 10 byte | 0 to 4,294,967,295 |