Original Post
How can i get the inherited class constructor to be called with an appropriate param. In other words, if i have two classes with their own param lists and i concatenate them, how can i pass parameters to both? The code below works, but i can''t pass the parameter to the inherited class constructor...
class classA
{
public:
classA(int num = 12);
~classA();
};
classA::classA(int num)
{
printf("\nclassA: %d",num);
}
classA::~classA()
{
printf("\nclassA out");
}
class classB : public classA
{
public:
classB(int num = 10);
~classB();
};
classB::classB(int num)
{
printf("\nclassB: %d",num);
}
classB::~classB()
{
printf("\nclassB out");
}
void main(void)
{
classB myclass(10); //param only for B, what about A?
getch();
}