Data types in C Language

A data type is a classification of data which tells the compiler or interpreter how the programmer intends to use the data. In another word you can say that it defines the size (BYTE) and the range of a variable.

Classification of the data types in C language

1. Pre-define data types
2. User define data types

Pre-define data types in C:

Already define by the C standard, these are int, char, float, double, …etc. Using the sizeof operator you can get the size of (in bytes) data types. These data types are dependent on the platform so C standard also introduces the fixed size of data type like uint8_t, uint16_t uint32_t …etc. These are defined in stdint.h header file for more detail you check this header file.

User-defined data types in C:

The C language also provides flexibility to the programmer to create own data types. A user-defined data type is created by the users using the tags struct, union or enum.

You can check out,

In C language, different data types have the different ranges. The range varies from compiler to compiler. In below table, I have listed some data types with there ranges and format specifier as per the 32-bit GCC compiler.