What is the difference between:
a)
class base{
int a;
public:
virtual int function();
};
class derived : public base{
int b;
public:
int function();
};
b)
class base{
int a;
public:
int function();
};
class derived : public base{
int b;
public:
int function();
};
Why would you use (a) and why would you use (b)?
Is (b) a kind of polymorphism?