i try to create an interface in c++ that enables me to use it as i want different types to implement it. getting :
cannot instantiate abstract class
for example :
BB.h
class BB {
public:
BB() {}
};
ICC.h
class BB;
class ICC {
public:
virtual BB launch(std::map<std::string, std::string>& ops) = 0;
};
C1.h
class C1: public ICC {
public:
C1() {}
BB launch(std::map<std::string, std::string>& ops){};
};
AA.h
class C1;
class AA {
public:
AA() {}
private:
ICC getC1() {
C1 c
return c;
}
ICC cc;
};
if I convert the ICC to pointer like this: ICC *cc all work fine but why do i need to use a pointer here?