Chapter 4: Data Types

ANSI C supports three classes of data types:
1. Primary or fundamental
2. User – defined
3. Derived

Primary or fundamental

Sl No Data Type Keyword Equivalent Description
1 Integer int Whole numbers, occupies one word of storage (16 bits of word for a 16-bit machine i.e., the range of numbers lie between 0 and 65,535)

short int

Occupies half the amount of storage a int uses

long int

Occupies double the amount of storage a int uses


Floating point


Real numbers, occupies 32 bit storage giving a precision of 6 digits (both 16 bit and 32 bit machine), 3.4E –38 to 3.4E +38

Double – precision floating point


Real numbers, occupies 64 bit storage giving a precision of 14 digits

long double

Occupies 80 bit storage giving a precision of 22 digits




No storage of values, used to specify the type of functions. Function is said to be void when it does not return any value to the calling function.




Single character, occupies 8 bit (one byte) of storage i.e., range between 0 and 255.



  • Defined Data Type
  • Enumerated Data Type

Defined Data Type

It allows a user to define an identifier (a name given according to the user’s choice) that would represent an existing data type, so that the user-defined data type can later be used to declare variables.

The syntax:

typedef <type> <identifier>;


                    typedef is the keyword for defining the data type

                    type refers to an existing data type

                    identifier refers to the new name given to the data type by the user         


typedef int roll;


         roll symbolizes int.

That means roll can be used in the program in place of int as follows:

           roll a;

Here the variable a is of int type.


I would like to learn more!

Leave a Reply

Your email address will not be published. Required fields are marked *