/************************************************ I used dmc for this, "dmc whatever.c", but most other C compilers should also work Declares a 'thestruct' struct and associates a function with the instance. The function simply returns the number 2 and the main program prints out that integer *************************************************/ #include typedef struct { int (* something)(); // pointer to function declared like this, // return_type (* func_name)(arguments) // this will be your object's behavior } thestruct; int func() // just does something useless, like return a constant { return 2; } void main() { thestruct a; // declare thestruct a.something = func; // associate the function 'func' with the emulated behavior // named 'something' printf("%d\n", a.something()); // call the behavior, like in C++ }