info@tutsfinder.in



Data Types


Data type defines the type of variable that which type of variable you are using in you program.

C language have pre defined set of data types to handle different type of data.

Eg. int a;

Primitive Data type - Primitive data types are fundamentals data types. There are 8 primitive data types, they are predefined by the language.

1. Byte

2. Short

3. Int

4. Long

5. Float

6. Double

7. Boolean

8. Char


Derived Data type - The data types that are derived from primitive data types are known as derived data types.

1. Array

2. Pointer


Enumeration - Enum is a user defined data type that is used to store constant values that makes a program readable and simple.


Structure - It is a user define data type which is used to grouping simple data types.



 Data Type  Size  Range
 char  1 byte  -128 to 127 or 0 to 255
 unsigned char  1 byte  0 to 255
 signed char  1 byte  -128 to 127
 int  2 or 4 bytes  -32,768 to 32,767 or -2,147,483,648 to 2,147,483,647
 unsigned int  2 or 4 bytes  0 to 65,535 or 0 to 4,294,967,295
 short  2 bytes  -32,768 to 32,767
 unsigned short  2 bytes  0 to 65,535
 long  8 bytes  -9223372036854775808 to 9223372036854775807
 unsigned long  8 bytes  0 to 18446744073709551615
 float  4 byte  1.2E-38 to 3.4E+38
 double  8 byte  2.3E-308 to 1.7E+308
 long double  10 byte  3.4E-4932 to 1.1E+4932