M
mwebel
Hi ikind of remember this being easy but cant find it on google:
i have a base class and a derived class.
The base class has two constructors normal and int overloaded one.
thing is i want the derived class to call the constructors for the base
class using also the same kind of overloading. like this:
class BASE{
public:
BASE();
BASE(int x);
}
class DERIVED : BASE{
//normal constructor
DERIVED(){
//init BASE with normal constructor
};
//overloaded constructor
DERIVED(int){
//init BASE with overloaded constructor
};
}
int main(){
//this should call the overloaded constructor of BASE!!!
DERIVED dummy(3);
return 1;
}
it would be my death if the wrong base constructor would be called or
even called twice...
thanks for any help!
i have a base class and a derived class.
The base class has two constructors normal and int overloaded one.
thing is i want the derived class to call the constructors for the base
class using also the same kind of overloading. like this:
class BASE{
public:
BASE();
BASE(int x);
}
class DERIVED : BASE{
//normal constructor
DERIVED(){
//init BASE with normal constructor
};
//overloaded constructor
DERIVED(int){
//init BASE with overloaded constructor
};
}
int main(){
//this should call the overloaded constructor of BASE!!!
DERIVED dummy(3);
return 1;
}
it would be my death if the wrong base constructor would be called or
even called twice...
thanks for any help!