Coupon Accepted Successfully!



  1. Operator overloading is one of the most helpful concepts introduced by C++ language. Operator overloading provides the capability to redefine the language in which working of operator can be changed.
  2. Overloaded operators are redefined within a C++ class using the keyword operator followed by an operator symbol. When an operator is overloaded, the produced symbol is called the operator function name.
  3. Overloading an operator cannot change the basic idea of an operator. When an operator is overloaded, its properties like syntax, precedence, and associatively remain constant.
  4. The keyword operator defines a new action or operation to the operator.
  5. The operator ++, −−, and – are unary operators. The unary operators ++ and −− can be used as prefix or suffix with the functions. These operators have only single operand.
  6. Binary operators require two operands. Binary operators are overloaded by using member functions and friend functions.
  7. The conversion routine may be single-argument constructor or an operator function. It depends on whether the object is a source or destination object.
  8. Defining multiple conversion routines puts the complier in an uncertain condition. The compiler fails to select appropriate conversion routines.
  9. There are three possibilities of data conversion. They are as follows:
    Conversion from basic data type to user-defined data type (class type) – the conversion from basic to class type is easily carried out. It is automatically done by the compiler with the help in-built routines or by applying type casting.
    Conversion from class type to basic data type – the compiler does not have any knowledge about the user-defined data type built using classes. In this type of conversion, the programmer needs to explicitly tell the compiler how to perform conversion from class to basic type. These instructions are written in a member function. Such type of conversion is also known as overloading of type cast operators.
    Conversion from one class type to another class type – when an object of one class is assigned to object of another class, it is necessary to give clear-cut instructions to the compiler about how to make conversion between these two user-defined data types. Using constructor or conversion this function can be performed.
  10. The conversion routine may be single-argument constructor or an operator function. It depends on whether the object it’s a source or destination object. Table (Conversion Types) describes conversion type and place of routine to be defined.

Test Your Skills Now!
Take a Quiz now
Reviewer Name