fork(1) download
  1. #include <stdio.h>
  2.  
  3. typedef int (*func_int_int)(int);
  4.  
  5. int sqr(int x)
  6. {
  7. return x * x;
  8. }
  9.  
  10. func_int_int get_f()
  11. {
  12. return sqr;
  13. }
  14.  
  15. int main(void)
  16. {
  17. func_int_int f = get_f();
  18.  
  19. int x = f(8);
  20. printf("%d", x);
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0s 4500KB
stdin
Standard input is empty
stdout
64