Overloading Operators Using Friends

C++-Overloading Operators Using Friends

Overloading Operators Using Friends Operator functions must be either member functions or friend functions. A basic difference between them is that a friend function will have only one argument for unary operators and two for binary operators, while a member function has no arguments for unary operators and only one for binary operators. This is … Read more…

Overloading Unary Operators

C++-Overloading Unary Operators

Overloading Unary Operators All operators having a single argument are unary operators. When we overload these operators as member functions, we do not need to pass any argument explicitly. The this pointer pointing to invoking object is passed as an implicit argument. Let us consider the unary minus operator. We know that this operator changes … Read more…

Operator Overloading

C++-Operator Overloading

Operator Overloading Operator overloading is one of the many exciting features of c++ language. It is an important technique that has enhanced the power of extensibility of c++. C++ tries to make the user defined data types behave inĀ  same way as the bulit-in types. For instance, C++ permits us to add two variables of … Read more…