E
ernesto
Hi everybody:
I have the following implementations:
class A
{
public:
virtual int GetValue() = 0;
};
class B : public A
{
public:
B(int aValue);
virtual ~B();
virtual int GetValue();
private:
int mValue;
};
class C
{
public:
C(A aValue);
private:
A mValue;
};
My questions are: Why the compiler cannot instantiate abstract class on
my "class C" constructor implementation?
I want my class to work with instances of classes derived from A and it
does not allow to me do it.
Is there another way to do it?
Best regards,
ernesto
I have the following implementations:
class A
{
public:
virtual int GetValue() = 0;
};
class B : public A
{
public:
B(int aValue);
virtual ~B();
virtual int GetValue();
private:
int mValue;
};
class C
{
public:
C(A aValue);
private:
A mValue;
};
My questions are: Why the compiler cannot instantiate abstract class on
my "class C" constructor implementation?
I want my class to work with instances of classes derived from A and it
does not allow to me do it.
Is there another way to do it?
Best regards,
ernesto