DEV Community

Laxmaningu
Laxmaningu

Posted on

Data types in C

A data type specifies the type of data that a variable can store such as integer, floating, character,
etc.
C Data Types
There are the following data types in C language.
Types Data Types
Basic Data Type int, char, float, double
Derived Data Type array, pointer, structure, union
Enumeration Data Type enum
Void Data Type void
Basic Data Types
The basic data types are integer-based and floating-point based. C language supports both signed
and unsigned literals.
The memory size of the basic data types may change according to 32 or 64-bit operating system.
Let's see the basic data types. Its size is given according to 32-bit architecture
Data
types
Memory
size
Range
char 1 byte -128 to 127
Signed char 1 byte -128 to 127
Unsigned
char
1 byte 0 to 255
short 2 byte -32,768 to 32,767
Signed short 2 byte -32,768 to 32,767
Unsigned
short
2 byte 0 to 65,535
Int 2 byte -32,768 to 32,767
Signed int 2 byte -32,768 to 32,767
Unsigned int 2 byte 0 to 65,535
Short int 2 byte -32,768 to 32,767
Signed short
Int
2 byte -32,768 to 32,767
Unsigned
short int
2 byte 0 to 65,535
Long int 4 byte -2,147,483,648 to
2,147,483,647Signed long
int
4 byte -2,147,483,648 to
2,147,483,647
Unsigned long
int
4 byte 0 to 4,294,967,295

Top comments (0)