C++ Fundamental Data Types - Maximum and Minimum value which can be stored in such type of variables

 

C++ Fundamental Data Types - Maximum and Minimum value which can be stored in such type of variables

C++ Fundamental Data Types:

Several of the basic types can be modified using one or more of these type modifiers 

  • signed
  • unsigned
  • short
  • long 

The following table shows the variable type, how much memory it takes to store the value in memory, and what is maximum and minimum value which can be stored in such type of variables.

C++ Fundamental Data Types - Maximum and Minimum value which can be stored in such type of variables
C++ Fundamental Data Types - Maximum and Minimum value which can be stored in such type of variables


C++ Fundamental Data Types - Maximum and Minimum value which can be stored in such type of variables
C++ Fundamental Data Types - Maximum and Minimum value which can be stored in such type of variables

C++ Fundamental Data Types:

  • long b = 4523232; 
  • long int c = 2345342; 
  • long double d = 233434.56343; 
  • short d = 3434233; // Error! out of range
  • unsigned int a = -5; // Error! can only store positive numbers or 0
The size of variables might be different from those shown in the above table, depending on the compiler and the computer you are using.
sizeof(datatype)
Example:
  • cout<<Sizeof(int);




Post a Comment

0 Comments