Home >>C++ Tutorial >C++ Data Types

C++ Data Types

C++ Data Types

The Data Types in C++ language generally specifies the type of data that can be stored in a variable like integer, floating, character, etc.

There are basically four types of data types that are known to be important in the C++ language:

Types Data Types
Basic Data Type int, char, float, double, etc
Derived Data Type array, pointer, etc
User Defined Data Type structure

Basic Data Types

The basic data types in C++ generally includes the floating point based and integer based data types. Unsigned and signed literals both are known to be supported by the C++ language.

Depending on the architecture of operating systems like 64 or 32 bit operating system, the memory size of the basic data types may generally change.

Here is the list of the basic data types that are according to the 32 bit architecture:

Data Types Memory Size Range
unsigned int 2 byte 0 to 32,767
char 1 byte -128 to 127
short 2 byte -32,768 to 32,767
signed char 1 byte -128 to 127
unsigned char 1 byte 0 to 127
unsigned short int 2 byte 0 to 32,767
short int 2 byte -32,768 to 32,767
signed short 2 byte -32,768 to 32,767
unsigned short 2 byte 0 to 32,767
int 2 byte -32,768 to 32,767
signed short int 2 byte -32,768 to 32,767
signed int 2 byte -32,768 to 32,767
double 8 byte  
long double 10 byte  
unsigned long int 4 byte  
float 4 byte  
signed long int 4 byte  
long int 4 byte  

No Sidebar ads