int foo( volatile int *x, int v ) { return *x - v; } int bar( volatile int *x, int v ) { return *x + v; } int main() { volatile int x = 4; int (*fun)( volatile int *, int ); fun = bar; fun( &x, 4 ); fun = foo; return fun( &x, 4 ); }