• Have Any Question?
  • contact@eitworld.com

C Data types

Data types in c determine the type of value stored in any variable or constant. In simple words, what kind of value is hold by the variable? Eitworld.com provides the easy learning for C Data Type with Examples in simple way. Data types in C Language are as follows:

Primitive data type: char, unsigned char, short, unsigned short, int, unsigned int, long, unsigned long, float, double, long double.

Derived data type: array, structure, union etc.

Enumerated data types: user defined data types declared using enum keyword.

Here eitworld.com you can learn about Data Types in C in easy way.

  • Data types determine the type of value stored in any variable or constant.
  • Size of value stored in the variable, constant or array are also determined the data type.
  • In C language data types are categorized in the following parts:
    • Basic or primitive data types
    • Derived data types
    • Enumerated data types
    • Void data type

Basic or primitive data type

The data types which are predefined in the C language and these are most commonly used to define the type of value stored in any variable, constant or array.

The primitive data types provided by the C language are as follows:

  • Integer data type:used to store integer values. C includes various integer type data types like short (signed), int (signed) , unsigned short, unsigned int, long(signed), unsigned long.
  • Character data type:used to store a single character. C language includes two types of character data type char (signed char) and unsigned char.
  • Floating point data type:Floating point data type decimal values. C include various floating point data type float, double, long double etc.

The entire primitive data types supported by C are explained below in the table:

data type

The sizes and ranges of int, short and long are compiler dependent. Sizes in this table are for 16-bit compiler.

Derived data type

  • The data types which are derived from the basic or primitive data types are known as Derived data types like array, structure, union etc.
  • We will study each of these derived data type in further section.

Enumerated data type

    • Enumerated data types are user defined data types.
    • Enumerated data types are declared using enum keyword.
    • It arranges a list of items in a sequence and associates a symbolic number to each element.
    • Syntax of Enumerated data type in C:
enum idenitifer{list of items);
    • Here is an example of enum containing the list of seven days of a week:
enum week { Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday};
  • In the above example Sunday, Monday, Tuesday and so on are the list of enumerated item. Their values are constant unsigned integers and start from 0 by default. So Sunday refers to 0, Monday refers to 1 and so on.


Here is an simple program of enum:



void main()


enum week { Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday};










The output of the above program is as follows:








Void data type

  • Void data type is an empty data type which does not contain any value.
  • It is basically used with the function and pointer.

Real Time Web Analytics