Data type specifies the type of data a variable will hold and following are the characteristics data type specifies for a variable.
- Size: the number of bytes allocated to hold data.
- Range: Minimum and maximum value a variable can hold.
- Operation that can be performed on a variable.
c programming language data types are classified into following:
- Primitive Data Types
- Derived Data Types
Primitive Data Types
- int – is used to hold whole numbers
- float -is used to hold real numbers
- char – is used to hold char values
- void – specifies no value.
Derived Data Types
- Array – To hold multiple value of same data type under a single variable.
- Pointer – Stores address of another variable
- Structure- To hold different variables under a single name
- Union
- Enum