Vectors of Pointers, inheritance
- by user308553
Hi I am a C++ beginner just encountered a problem I don't know how to fix
I have two class, this is the header file:
class A
{
public:
int i;
A(int a);
};
class B: public A
{
public:
string str;
B(int a, string b);
};
then I want to create a vector in main which store either class A or class B
…