I have a value in the derived class that I want to return using a function from the base class, is that possible? Or do I have to have the variable declared in the base class to do so?
Would I just call the function in the derived class?
class Base
{
public:
int getNum() const { return number; }
};
class Derived : public Base
{
private:
int n = 50;
};