Re: If default constructor is not there and parameterized constructor is there, will it work ??
- From: "Jigar Mehta" <jigar.programmer@xxxxxxxxx>
- Date: Mon, 16 May 2005 00:28:04 +0530
Ya.. thanks for that..
"Arnaud Debaene" <adebaene@xxxxxxxxxxxxxxxx> wrote in message
news:OqUy0YXWFHA.2796@xxxxxxxxxxxxxxxxxxxxxxx
> Jigar Mehta wrote:
> > Hi,
> > the point i wanted to make was it does not run successfully when we
> > derive the class and base class does not have default constructor..
> Of course it does! You just need to supply the correct base class
> constructor call in the derived class initialization list !
>
> class Base
> {
> public :
> Base (int param) {};
> };
>
> class Derived : public Base
> {
> public :
> Derived() : Base(5) {}; //works
> Derived (int param2) : Base (param2) {}; //works too
> };
>
> Arnaud
> MVP - VC
>
>
.
- References:
- If default constructor is not there and parameterized constructor is there, will it work ??
- From: Jigar Mehta
- Re: If default constructor is not there and parameterized constructor is there, will it work ??
- From: Arnaud Debaene
- Re: If default constructor is not there and parameterized constructor is there, will it work ??
- From: Jigar Mehta
- Re: If default constructor is not there and parameterized constructor is there, will it work ??
- From: Fred
- Re: If default constructor is not there and parameterized constructor is there, will it work ??
- From: Jigar Mehta
- Re: If default constructor is not there and parameterized constructor is there, will it work ??
- From: Arnaud Debaene
- If default constructor is not there and parameterized constructor is there, will it work ??
- Prev by Date: Re: How to convert a vector type into string?
- Next by Date: Re: How to convert a vector type into string?
- Previous by thread: Re: If default constructor is not there and parameterized constructor is there, will it work ??
- Next by thread: Opening a web page in my program
- Index(es):
Relevant Pages
|