#include int d(int x){ return x+x; } int t(int x){ return x*3; } int double_op(int number, int (*operation)(int)){ return operation(operation(number)); } struct operations { int (*doubler)(int); int (*tripler)(int); }; int main(){ struct operations ops; ops.doubler = d; ops.tripler = t; // tester(&ops) printf("16 doubled is %d\n", ops.doubler(16)); int x = 10; printf("%d doubled is %d\n", x, d(x)); int (*operation)(int) = d; printf("%d doubled is %d\n", x, operation(x)); operation = t; printf("%d doubled is %d\n", x, operation(x)); printf("%d double doubled is %d\n", x, double_op(x, d)); printf("%d double tripled is %d\n", x, double_op(x, t)); return 0; }