As the name suggests, a Datatype defines the type of data being used. Whenever we define a variable or use any data in the C language program, we have to specify the type of the data, so that the compiler knows what type of data to expect.
For example, you may want to use a number like 1, 2, 100, or a decimal point number like 99.95, 10.5, or a text, like “Studytonight”, all these values are handled differently by the C language compiler, hence, we use data types to define the type of data used in any program.
C Datatypes
Broadly, there are 5 different categories of data types in the C language, they are:
Type | Example |
---|---|
Basic | character, integer, floating-point, double. |
Derived | Array, structure, union, etc. |
Enumeration | enums |
Bool type | true or false |
void | Empty value |

C Primary Data types:
The C language has 5 basic (primary or primitive) data types, they are:
- Character – ASCII character set or generally a single alphabet like ‘a’, ‘B’, etc.
- Integer – Used to store whole numbers like 1, 2, 100, 1000, etc.
- Floating-point – Decimal point or real numbers values like 99.9, 10.5, etc.
- Double – Very large numeric values which are not allowed in Integer or Floating point type.
- Void – This means no value. This data type is mostly used when we define functions.
There are different keywords to specify these data types, the keywords are:
Datatype | Keyword |
---|---|
Character | char |
Integer | int |
Floating-point | float |
Double | double |
Void | void |