C++ Program showing assignment operator overloading
The symbol ‘=’ is used as Assignment operators. It is used to assign a value of result for an expression.
This is a sample program showing the overloading of Assignment operators in c++.
Int x, y;
Void getdata ()
Cout <<” \n enter the value of x and y”;
Void operator = (sample obj)
Void display ()
Cout<<”\n value of x”<<x;
Cout<<”\n value of y”<<y;
Void main ()
Sample obj1, obj2;
- Overloading Binary Operator Overloading binary operator An operator requiring two operand is called...
- C++ Program showing constructor overloading Constructor is a member function with the same name as...
- C++ Program Using Friend Function Friend function is used to access private, public and protected...
- C++ Program Using getdata() and display() The program uses member function getdata() and display() in-order to...
- Class Template Class Template A class template is a class definition that...