Virtual functions - base class pointer
- by user980411
I understood why a base class pointer is made to point to a derived class object. But, I fail to understand why we need to assign to it, a base class object, when it is a base class object by itself.
Can anyone please explain that?
#include <iostream>
using namespace std;
class base {
public:
virtual void vfunc() {
…