/* Bow / bow back Single event / single threaded Idea from Java Puzzlers */ #include #include struct Friend { char name[20]; }; void initFriend(struct Friend* friend, const char* name) { strcpy(friend->name, name); } void bowBack(struct Friend* bowee, struct Friend* bower) { printf("%s: I bow back to %s\n", bowee->name, bower->name); } void bow(struct Friend* bower, struct Friend* bowee) { printf("%s: I bow to %s\n", bower->name, bowee->name); bowBack(bowee, bower); } int main() { struct Friend alphonse; initFriend(&alphonse, "Alphonse"); struct Friend gaston; initFriend(&gaston, "Gaston"); bow(&alphonse, &gaston); }