Written by - Vanshika Yadav

Data Types in C


Data type tell us that how much storage/memory to be allowed to a variable.

TypesData Types
Basic data type int,char,float,double
Derived data typeArray,pointer,structure,union
Enumeration data typeEnum
Void data typevoid

Basic data type:
They are arithmetic types and are further classified into: (a) integer types and (b) floating-point types.
Memory size of data type may change according to 32-bit or 64-bit operating system.

Data Type Memory SizeRange
Char1 byte−128 to 127
signed char1 byte−128 to 127
unsigned char1 byte0 to 255
short2 Byte-32,768 to 32,767
signed short2 byte-32,768 to 32,767
unsigned short2 byte0 to 65,535
int2 byte−32,768 to 32,767
signed int2 byte−32,768 to 32,767
unsigned int2 byte0 to 65,535
short int2 byte−32,768 to 32,767
signed short int2 byte−32,768 to 32,767
unsigned short int2 byte0 to 65,535
long int4 byte-2,147,483,648 to 2,147,483,647
signed long int4 byte-2,147,483,648 to 2,147,483,647
unsigned long int4 byte0 to 4,294,967,295
float4 byte-2,147,483,648 to 2,147,483,647
double8 byte-2,147,483,648 to 2,147,483,647
long double10 byte0 to 4,294,967,295