The problem was we are given three classes: We can make the variables public . It was not mentioned in problem, we were give code block which we need to complete and we were allowed to choose the acess specifiers of class.By default it was private . We can make one class inherit the other or any type of changes but can't change the no and type of variables .
class A{
int a,b;
};
class B{
int c,d,e;
};
class C{
int f,g;
};
We need to overload (>>) extraction and (<<) insertion operator , such that they will be valid for all the three classes.
We need to create 1 overloading function for (>>) extraction and 1 overloading function for (<<) insertion which will work for all the three classes.
I know how to overload operators for one class, but for more than one class I have no idea.