Each variable in C should be initialised or defined with a data storage format to continue with the operations in the program. These data storage formats are known as data types. A variable should be defined with a data type before using it in the program.
Data types in C are divided into 4 different types:
- Basic data types
- Enumeration data type
- Derived data types
- Void data type
Let us discuss them one by one.
Basic data types:

Integer (int) data type:
- This particular data type helps you to store numeric values.
- It is should be represented by the int keyword.
- It cannot store decimal values.
- In 16 bit processor, it takes 2byte of memory to get allocated.
- In 32 bit processor, it takes 4byte of memory to get allocated.
- In 64 bit processor, it takes 8byte of memory to get allocated.
- Example:166
Character (char) data type:
- This data type helps you to store one character.
- It should be represented by the char keyword within a single inverted comma.
- The size of the char in every processor is 1byte.
- Example: ’R’
Float (float) data type:
- This data type helps you to store numeric value with decimal.
- It should be represented by the float keyword.
- It can store up to 6 digits after the decimal.
- The storage size of a float is 4, but it varies depending upon the processor.
- Example:10.324567
Double (double) data type:
- This data type is the same as that of float holding decimal values.
- It is should be represented by double keyword.
- It can store up to 10 digits after decimal.
- The storage size of double is 8.
The program below shows the example of the different basic data type.
Enumeration data type:
- Enumeration is represented by enum datatype.
- Enumeration data type comprises of named integer.
- It can be referred to as a list.
- Example: {ab,cd,ef}
The program below shows the enumeration data type.
Derived data types:
- These data types are derived by the user itself.
- They consist of array, pointer, structure, union.
- We will discuss more about derived data types as we deep dive into the language.
Void data type:
- As the name specifies, void is an empty data type.
- It has no value.
- They can be used in functions and pointers.
Hence we come to the end of the discussion on data types in C language.
Please write comments or WhatsApp if you find anything incorrect, or you want to share more information about the topic discussed above.