Type Conversion in C++

C++ provides mechanism to perform automatic type conversion if all variable are of basic type. For user defined data type, programmers have to convert it by using constructor or by using casting operator. The type of data to the right of an assignment operator is automatically converted to the data type of variable on the left. Consider the following example: This converts float variable y to an integer before its value assigned to x. The type conversion is automatic as far as data types involved are built in types. We…

Read More