Text: Object Oriented C++ Coding
Part III (CLO3) (10 Marks)
Q3: Consider the given program, find if there is an error, also write the output. (5)
Note: No statement (line of code) should be removed.
#include <iostream>
using namespace std;
class A {
public:
A& operator=(const A& a) {
cout << "A's assignment operator called" << endl;
return *this;
}
};
class B {
A a[2];
};
int main() {
B b1, b2;
b1 != b2;
b1 == b2;
b1 = b2;
return 0;
}