Data Types in C
- C supports different types of data, each of which may be represented differently within a computer’s memory.
- Data type is used to determine what type of value a variable or a constant can contain throughout the program.
- Data types were already pre-defined and we have to choose one data type among all according to the size of the data and type of the data that what you are going to work with.
- A data type is used to identify the type of a variable when the variable is declared, to identify the type of the return value of a function and to identify the type of a parameter expected by a function
Economize the memory space.
Improve the speed of
execution of program.
In C language, it is compulsory to declare variables with their data-type before using them in any statement.
Mainly data types in c are categorized into 3 categories:
1. Primitive Data Types
2. Derived Data Types
3. User Defined Data Type