The idea is to put a pointer to a function inside the struct. The function is then declared outside of the struct. This is different from a class in C++ where a function is declared inside the class.
For example: stealing code from here: https://web.archive.org/web/20121024233849/http://forums.devshed.com/c-programming-42/declaring-function-in-structure-in-c-545529.html
struct t {
int a;
void (*fun) (int * a);
} ;
void get_a (int * a) {
printf (" input : ");
scanf ("%d", a);
}
int main () {
struct t test;
test.a = 0;
printf ("a (before): %d\n", test.a);
test.fun = get_a;
test.fun(&test.a);
printf ("a (after ): %d\n", test.a);
return 0;
}
where test.fun = get_a; assigns the function to the pointer in the struct, and test.fun(&test.a); calls it.