On 3/31/08, Yukihiro M. [email protected] wrote:
|I have another class B, written in C, that derives from class A and
functions for class B should handle whole body of C structure (both A
Thank you Matz.
Right now, I’ve coded both classes separately, thus duplicating code.
That’s why it occurred to me to derive one from the other.
Most of the C structure is shared among both classes, except for one
This field, and another one that is common to both classes, are
pointers to database resources that must be allocated at
initialization and freed when the object is destroyed.
I wasn’t sure that, for example, in the free function, I may free only
the derived class’ database resource and expect that the free function
of the base class frees the other database resource and the structure
Or, that at initialization, I could expect that, after calling super,
the derived class can be confident that the C structure and the first
database resource were already allocated, and allocate the other