Below is my code
Class A
{
A::A(int num) { }
int num;
};
class B : public A
{
B::B(int num):A(num) { }
};
Class D;
Class C
{
void getNum(A**& somenum) {}
D *dObj;
};
void C::getNum(A**& somenum)
{
dObj->getNumber(static_cast<B**>(somenum)); // Error here.
}
Class D
{
void getNumber(B**& number)
{
B someValue[5];
// all the objects in the array are properly created and properly Initalized (skipped that part)
number[0] = someValue[0];
number[1] = someValue[1];
//...
}
};
I'm getting compilation error while doing the static_cast. I am trying to assign the values in "someValue" array to "A**& somenum". Can you please help how to do it.
Thank you very much in advance.