#include <stdio.h>

struct Structure {
    int a;
    void (*function)(struct Structure *);
};

void foo(struct Structure *a) {
    if (a->function == NULL) a->function = foo;
    a->a++;
    printf("%d\n", a->a);
}

int main(void) {
    struct Structure a = {42, foo};
    struct Structure b = {0}; // don't call b.function just yet!!
    a.function(&b); // foo(&b)
    b.function(&a); // foo(&a)
}
