In the series of learning programming, we learned about data types. Data type is a system for defining various properties of data stored in memory. Properties such as, type of data, range of data, bytes occupied etc.
Data type in C programming is categorized three categories.
- Primitive data type
- Derived data type
- User defined type
Read more – List of all format specifiers in C
Below is the list of all primitive and derived type in C programming.
List of primitive and derived data type in C
|1 byte||-128 to 127||A character|
|1 byte||0 to 255||A character|
|2 bytes||−32,767 to 32,767||Short signed integer of minimum 2 bytes|
|2 bytes||0 to 65,535||Short unsigned integer of minimum 2 bytes|
|2 or 4 bytes||-32,768 to 32,767 or -2,147,483,648 to 2,147,483,647||An integer (Both positive as well as negative)|
|2 or 4 bytes||0 to 65,535 or 0 to 4,294,967,295||An unsigned integer (Positive integer)|
|4 bytes||-2,147,483,648 to 2,147,483,647||Long signed integer of minimum 4 bytes|
|4 bytes||0 to 4,294,967,295||Long unsigned integer of minimum 4 bytes|
|8 bytes||-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807||Integer with doubled capacity as of long|
|8 bytes||0 to 18,446,744,073,709,551,615||Unsigned integer with doubled capacity as of long|
|4 bytes||1.2E-38 to 3.4E+38||Single precision floating point number|
|8 bytes||2.3E-308 to 1.7E+308||Double precision floating point number|
|12 bytes||3.4E-4932 to 1.1E+4932||Double precision floating point number|
Important note: Size and range of data type is compiler dependent which may vary.
Read more –