Can I inherit a structure in C? If yes, how?
You can do the above mentioned
typedef struct { // base members } Base; typedef struct { Base base; // derived members } Derived;
But if you want to avoid pointer casting, you can use pointers to a union of Base and Derived.
union
Base
Derived