Range and Size of Data Types in C++ Hindi Urdu

Описание к видео Range and Size of Data Types in C++ Hindi Urdu

While Doing Programming you need to use variables to store different information.

You may like to store information of various data types in c++ like character, wide character, integer, floating point, double floating point, boolean etc. Based on the data type of a variable in c++ , the operating system allocates memory and decides what can be stored in the reserved memory.
How to Create Variables in C++::

A variable in c++ definition means to tell the compiler where and how much to create the storage for the variable. A variable in c++ definition specifies a data type, and contains a list of one or more variables of that type as follows :
type variablename1 , variablename2;

Here, type must be a valid C++ data type.

Initialization and Declaration in C++::
When a variable in c++ is defined but value is not assigned to it at time of creation it is termed as declaration in c++ or declaration:
example is: int x;

Same when a variable is defined and a value is assigned to it at time of creation this is called initialization in c++ or initialization.
example is: int x =10;
Size of Data types and their Range::

Data Type in C++ Size of Data Type Range of Data Type
char 1byte -128 to 127 or 0 to 255
unsigned char 1byte 0 to 255
signed char 1byte -128 to 127
int 4bytes -2147483648 to 2147483647
unsigned int 4bytes 0 to 4294967295
signed int 4bytes -2147483648 to 2147483647
short int 2bytes -32768 to 32767
unsigned short int 2bytes 0 to 65,535
signed short int 2bytes -32768 to 32767
long int 8bytes -2,147,483,648 to 2,147,483,647
signed long int 4bytes -2,147,483,648 to 2,147,483,647
unsigned long int 4bytes 0 to 4,294,967,295
float 4bytes +/- 3.4e +/- 38 (~7 digits)
double 8bytes +/- 1.7e +/- 308 (~15 digits)
long double 8bytes +/- 1.7e +/- 308 (~15 digits)
wchar_t 2 or 4 bytes 1 wide character

Комментарии

Информация по комментариям в разработке