In the C programming language, data types refer to an extensive system used for declaring variables or functions of different types. The type of a variable determines how much space it occupies in storage and how the bit pattern stored is interpreted.
There are 4 types of data types in C language.
|Basic Data Type||int, char, float, double|
|Derived Data Type||array, pointer, structure, union|
|Enumeration Data Type||enum|
|Void Data Type||void|
They are arithmetic types and consists of the two types: (a) integer types and (b) floating-point types.
The memory size of basic data types may change according to 32 or 64 bit operating system.
Let's see the basic data types. It size is given according to 32 bit OS.
|Data Types||Memory Size||Range|
|char||1 byte||−127 to 127|
|signed char||1 byte||−127 to 127|
|unsigned char||1 byte||0 to 127|
|short||2 byte||−32,767 to 32,767|
|signed short||2 byte||−32,767 to 32,767|
|unsigned short||2 byte||0 to 32,767|
|int||2 byte||−32,767 to 32,767|
|signed int||2 byte||−32,767 to 32,767|
|unsigned int||2 byte||0 to 32,767|
|short int||2 byte||−32,767 to 32,767|
|signed short int||2 byte||−32,767 to 32,767|
|unsigned short int||2 byte||0 to 32,767|
|long int||4 byte|
|signed long int||4 byte|
|unsigned long int||4 byte|
|long double||10 byte|