Hello all,
Does anyone know why can I not put the call to the constructor of a base within the body of the derived class constructor? Here an example:
I'm particularly interested int the case when a is not given in the call to test::test, but calculated within its body.Code:class A
{
int a;
public:
A(int ext_a);
};
A::A(int ext_a):a(ext_a)
{}
class test : public A
{
int t;
public:
test(int a, int ext_t);
};
test::test(int a, int ext_t)
{
A(a);
t=ext_t;
}
Thanks