2080.1 1

Object Oriented Programming2080.110 marksOverloading unary and binary operator

Write a program to create a class named height with data members meter(int) and centimeter(int). Overload the binary + operator using friend function to add two heights.

Write a program to create a class named height with data members meter(int) and centimeter(int). Overload the binary + operator using friend function to add two heights.[10]

Binary Operator Overloading occurs when an operator works on two operands. When overloaded using a friend function, the function is not a member of the class but has access to all private and protected members of the class. A friend function takes both operands as explicit parameters (unlike memb...

Up nextWhat is destructor? List its characteristics. Explain the use of default copy constructor