| Data Types |
| |
| Introduction |
| |
| To communicate with the computer, it is required to pass an appropriate value to the computer from the keyword. |
| |
| The value passed may be of different types, viz. Single character, integer, decimal, string. |
| |
| In each, the memory required is of different size. Such a defined type of value is called data type. |
| |
| C supports several different types of data, each of which may be represented differently within the computers memory. |
| The memory requirement of each data type will determine the permissible range of values for that data type. |
| |
| C data type can be broadly divided in two categories: |
| |
| (a) Primary data types. |
| (b) Secondary data types. |
| |
| Primary data types |
| |
| Primary data types are independent data types. It's not derived from other basic or secondary data types. |
| |
| There are five primary data types in C language: |
| |
| 1. Void |
| 2. Character |
| 3. Integer |
| 4. Float |
| 5. Double |
| |
| Secondary data types |
| |
| Secondary data types are also called as derived data types. Secondary data types are derived from the basic data types. |
| |
| They are also five in number: |
| |
| 1. Array |
| 2. Pointer |
| 3. Structure |
| 4. Union |
| 5. Enum |
| |
| |
|
| |
| |