I would do:
Code:
class Test
{
private:
int a, b;
public:
Test( int a, int b ){ this->a = a, this->b = b; }
virtual void print=0; //make abstract
}
class TestChild :: public Test
{
private:
int a, b, c
public:
TestChild( int a, int b, int c ) : Test(a, b)
{
this->c = c;
}
void print(){ cout << "I am printing..."; }
}
Also, I prefer to use different names for the arguments to the constructor and the class members.
E.g:
Code:
TestChild( int aa, int ab, int ac ) : Test(aa, ab)
{
c = ac;
}
That way, you don't need to use "this->" all over the place.
Neither of my suggestions will affect what happens.
--
Mats