What does -- it look messy already!
There is no purpose emulating OOP like that; you are in effect putting a constraint on yourself as if you had to use it. When you have something concrete you are doing, there are always a few obvious ways to customize the process.
What wrong with
Code:struct animal { char sound[32]; char food[32]; }; struct dog { struct animal *aptr; } void dog_construct(struct dog *this) { strcpy(this->aptr->sound, "woof woof"); strcpy(this->aptr->food, "cat"); } function animalspeak (struct animal *ptr) { say ptr->sound; } struct dog a; dog_construct(&a); animalspeak(a.aptr);



1Likes
LinkBack URL
About LinkBacks



