F
Fabian Müller
Hi all,
my question is as follows:
If have a class X and a class Y derived from X.
Constructor of X is X(param1, param2) .
Constructor of Y is Y(param1, ..., param4) .
How can I call the constructor/destructor of X from the
constructor/destructor of Y, before I the rest of the code of
constructor/destructor of Y.
Can I use the 'this' keyword. It gets compiled for the destructor but doen't
for the constructor. ( ((X*) this)->X( ... ) )
When calling the constructor of X from the constructor of Y, with X(...) it
gets compiled, but seems not to work, because I get segmentation errors at
runtime.
Many thanks to any advice.
Fabian Müller
my question is as follows:
If have a class X and a class Y derived from X.
Constructor of X is X(param1, param2) .
Constructor of Y is Y(param1, ..., param4) .
How can I call the constructor/destructor of X from the
constructor/destructor of Y, before I the rest of the code of
constructor/destructor of Y.
Can I use the 'this' keyword. It gets compiled for the destructor but doen't
for the constructor. ( ((X*) this)->X( ... ) )
When calling the constructor of X from the constructor of Y, with X(...) it
gets compiled, but seems not to work, because I get segmentation errors at
runtime.
Many thanks to any advice.
Fabian Müller