Data Types in C++

Data Types in C++




C ++ provides following data types :

  
we can derive data types into three parts:

  1. Primary data type
  2. Derived data type.
  3. user defined data type


Primary data type 


It is also known as inbuilt data type.

char :

 Size : 1 byte
 Range : -128 to 127

unsigned char :

 Size : 1 byte
 Range : 0 to 255

short or int :

 Size : 2 byte
 Range : -32,768 to 32,767

unsigned int :

 Size : 2 byte
 Range : 0 to 65535

long :

 Size : 4 byte
 Range : -2147483648 to 2147483648

unsigned long :

 Size : 4 byte
 Range : 0 to 4294967295

float :

 Size : 4 byte
 Range : 3.4e-308 to 3.4e+308

double :

 Size : 8 byte
 Range : 1.7e-308 to 1.7e+308

long double :

 Size : 10 byte
 Range : 3.4e-4932 to 1.1e+4932

Derived data type

  
Array : Array is a fixed sized sequence collection of elements of the same data type.
Function : a group of statements combined into one block for specific purpose.
Pointer : Pointer is a special variable which contains address of another variable.

User Defined data type


An user defined data type is defined by programmer as per his/her requirement.
Structure : Structure is a collection of logically related data of different data types grouped together and known by a single name.
Union : Union is like a structure, except that each elements share the common memory.
Class : Class is a blueprint or prototype from which objects are created.

Comments

Popular posts from this blog

What Is Operating System? Knowledge Of OS!!

Trending Pieces Of Technology You Should Know About!!!

Basic Concepts Of OOPC!!