मराठी

C++ Data Types

Advertisements

Data Types

  • Built-in type is also called a basic or primary data type. There are five basic data types. Integer (int), character (char), float (float), double (double), and void (void) are the basic data types.
  • The user-defined data types are structure, union, class, and enumeration; they are defined by the user in the programs as per the programmer. 
  • The derived data types are also called structured data types or secondary data types. They are formed by using basic data types of the language. Array, Function, Pointer are derived data 
    types
Name  Bytes* Description Range*
char 1 Character or integer 8 bits long signed : -128 to 127
unsigned : 0 to 255
short 2 Integer 16-bits length signed : –32768 to 32767
unsigned : 0 to 65535
long  4 Integer 32-bits length signed : –2147483648 to 2147483647
unsigned : 0 to 4,294,967,2955
int * Integer Its length traditionally depends on the length of the system's word type ; thus, in MSDOS, it is 16 bits long. Whereas in 32-bit systems (like Windows 9x/200/NT and systems that work under protected mode in x86 systems), it is 32 bits long (4 bytes). See short, long 
float  4 floating-point number 3.4e + / - 38 (7 digits)
double  8 double precision floating point number 1.7e +/ - 308 (15 digits)
long double 10 long double precision floating-point number. l.2e +I - 4932 (19 digits)
bool  1 Boolean value. It can take one of two values : true or false. NOTE : This is a type recently added by the ANSI-C++ standard. Not all compilers support it. True or False

 

 

Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×