In my experience in object oriented C programming I have seen two ways to implement derived classes.
First Method, have a definition of the pa
I have used method #2 before and found it works quite ok:
free() on the pointer to the base structure will of course also free up the derived fields, so that isn't an issue...
Also, I find accessing base fields something I tend to do in a polymorphic situation: I only care about those fields in methods that care about the base type. Fields in the derived type are used in methods only interested in the derived type.