A
Aman
Hi,
Why does the member initialization list not work for derived members
but the assignment within the constructor works fine ?
ex ->
class X{
protected :
short int i ;`
};
class Y: public X{
public :
Y() ;
} ;
Y::Y() : i(10) {} // this gives compilation error
Y::Y() { i = 10 ;} // this works fine .
why is that ?
regards,
Aman .
Why does the member initialization list not work for derived members
but the assignment within the constructor works fine ?
ex ->
class X{
protected :
short int i ;`
};
class Y: public X{
public :
Y() ;
} ;
Y::Y() : i(10) {} // this gives compilation error
Y::Y() { i = 10 ;} // this works fine .
why is that ?
regards,
Aman .