Category: Type conversion in C++

Interested in learning C Programming? Click here...


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:

In the above example, in expression:

firstly, variable c of the type int is converted to type float and is stored in a temporary variable before being...