class Base{
public:
int getNum();
private:
int numToGet;
}
class Derived: public Base {
public:
friend ostream& operator<<(ostream& output, const Derived &B);
}
ostream& operator<<(ostream& output, const Derived &B) {
// I would like to call getNum from the base class,
// but using B.getNum() was returning
// "passing 'const Derived' as 'this' argument of int Base::getNum()'
// discards qualifiers
int main()
Derived B;
cout << B;