Hello, let's say I have an abstract class with a few pure abstract functions and a few classes that derive from it, and all of the data from these classes eventually becomes similar, I was wondering if it would be wise, or even possible, to declare a vector under protected in the abstract class to collect the data so something like that.
class A
{
protected:
vector <string> str;
public:
virtual function x();
virtual function y(); //etc etc
virtual ~A(){;}
};
class B : public A
{
public:
function x();
function y();
};
class C: public A
{
//similar to class B
} ;
I'm having trouble understanding how pure virtual functions operate in C++; I understand polymorphism because I've done a lot of java projects with it.
Is it even feasible to define and utilise that vector in C++ because abstract classes cannot be instantiated?