Answer the question
In order to leave comments, you need to log in
How to create an instance of a class that implements an interface?
I create an abstract class:
class iClass {
public:
void method1();
virtual method2();
}
class myClass : public iClass {
/*тут методы родителя*/
void method3();
}
iClass c = new myClass();
Answer the question
In order to leave comments, you need to log in
The issue was resolved by typecasting:myClass c = (myClass * ) new iClass();
The tin is full.
class iClass { public: void method1(); virtual method2(); }
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question