Question
1.
#include
2.
using namespace std;
3.
class Integer
4.
{
5.
int i;
.
public:
7.
Integer(int ii) : i(ii) {}
8.
const Integer
9.
operator+(const Integer& rv) const
10.
{
11.
cout
1.
#include
2.
using namespace std;
3.
class Integer
4.
{
5.
int i;
.
public:
7.
Integer(int ii) : i(ii) {}
8.
const Integer
9.
operator+(const Integer& rv) const
10.
{
11.
cout
Answer: Option A
Was this answer helpful ?
Answer: (a)
Explanation:We are using two operator functions and executing them and result is printed according to the order.
Output:
$ g++ oper2.cpp
$ a.out
operator+
operator+=
Was this answer helpful ?
More Questions on This Topic :
Question 2.
How to declare operator function?
....
Question 4.
Pick the other name of operator function.
....
Submit Solution