Category: Type conversion in C++

Type Conversion in Cpp 0

Type Conversion in C++

Type Conversion means conversion of one data-type to another data-type. In C Plus Plus (C++), type conversion can be done by two ways: Automatic Conversion Type Casting 1) Automatic Conversion: In C++, if we have mixed mode expression (i.e., different types of data in one expression) then the lower data-type variable is automatically converted to the data-type of the higher data-type variable. Let us illustrate this with am example as follows: int c = 7; float a = 155.5; double t = c * a; In the above example, in expression: double t = c * a; firstly, variable c...