fork download
  1. #include <stdio.h>
  2.  
  3. typedef void(*my_callback_t)(int, int);
  4.  
  5. void DoSMTH(int a1, int b1)
  6. {
  7. printf("%d, %d\n", a1, b1);
  8. }
  9.  
  10. int DoSMTHwithSMTH(my_callback_t cb)
  11. {
  12. cb(1, 2);
  13. return 1;
  14. }
  15.  
  16.  
  17. int DoSMTHwithSMTH2(void(*cb)(int, int))
  18. {
  19. cb(2, 3);
  20. return 1;
  21. }
  22.  
  23. int main()
  24. {
  25. DoSMTHwithSMTH(DoSMTH);
  26. DoSMTHwithSMTH2(DoSMTH);
  27. return 0;
  28. }
  29.  
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
1, 2
2, 3