Data type in c++.

     
Data type


A data type or simply type is an attribute of data which tells the compiler or  interpreter how the programmer intends to use the data. Most programming languages support basic data types of integer numbers of varying sizes floating point numbers (which approximate real numbers characters and boolen. A data type constrains the values that an expression, such as a variable or a function, might take. This data type defines the operations that can be done on the data, the meaning of the data, and the way values of that type can be stored. A data type provides a set of values from which an expression (i.e. variable, function, etc.)





Basic TypeInteger Type(int)
Floating Type(float)
Character Type(char)
Derived TypePointer
Array
Structure
Union

Integer data type

Data TypeSize in bytesRange
short2-32768 to +32767
int2-32768 to +32767
unsigned int20 to 65536
long4-2147483648 to +2147483647
unsigned long int40 to 4,294,967,295

             
Float type

Data TypeSize in bytesRange
float43.4E-38 to 3.4E+38
double81.7E-308 to 1.7E+308
long double103.4E-4932 to 1.1E+4932

Character type

Data TypeSize in bytesRange
char1-128 to +127
signed char1-128 to +127
unsigned char10 to 255

Comments

Popular posts from this blog

Function in C++ with example & declaration, initialization function in c++

Operators of c++

Storage class in c++