Virtual Classes Logo          Virtual Classes
    Read Anytime,Anywhere

Data Types

When we create a variable and assign a value to it,the values of variables are stored in the computer memory as zeros and ones. Our program does not need to know the exact location where a variable is stored; it can simply access the variable and it's value by its name. Our program is just needs to be aware of kind of data is stored in the variable. Our program store/fetch string variable differently then it store/fetch interger or boolean varibales even though thy are all represented using zeros and ones, but they are not interpreted in the same way, and in many cases,they don't occupy the same amount of memory.

Fundamental data types
1-Character types: They can represent a single character, such as 'A' or '*'.This is a one-byte character.
2-Numerical integer types: They can store a number value, such as 10 or 1024. They exist in a variety of sizes, and can either be signed or unsigned, depending on whether they support negative values or not.
3-Floating point types: They can store floating point values,such as 1.5 or 0.01, with different levels of precision, depending on which of the three floating-point types is used.
4-Boolean type: The boolean type,can only store boolean variable having only two states, true or false.

Below table show list of data type available in C++ with their range.
Data Types in C++