#include #include #include #include "people.h" /* farmer methods */ Farmer* initFarmer (void) { Farmer *person = (Farmer *)malloc(sizeof(Farmer)); person->setName = setName; person->setAge = setAge; person->getName = getName; person->getAge = getAge; person->work = workFarmer; person->destroy = destroy; return person; } static Status workFarmer (Farmer *person) { Farmer *farmer= (Farmer *)person; printf ("Irrigating ... "); printf ("Status = %d\n", ++(farmer->irrigation)); return 0; }