fork download
  1. #include <stdio.h>
  2.  
  3. typedef int (*func_t) (int, int);
  4.  
  5. static int g(func_t fn, int x, int y) {
  6. return (*fn) (x, y);
  7. }
  8.  
  9. static int f1(int x, int y) {return x + y;}
  10. static int f2(int x, int y) {return x - y;}
  11. static int f3(int x, int y) {return x * y;}
  12.  
  13. int main(int argc, char *argv[]) {
  14. int c = g(f3, g(f2, 7, 5), g(f1, 7 , 5));
  15. }
Success #stdin #stdout 0.01s 5296KB
stdin
Standard input is empty
stdout
Standard output is empty