fork(21) download
  1. #include <iostream>
  2. typedef void(*callback_t)(void*data);
  3.  
  4. callback_t call_t;
  5.  
  6. void Fm_show(callback_t call){
  7. call_t=call;
  8. }
  9.  
  10. void foo(){
  11. call_t(NULL);
  12. }
  13.  
  14. void foo2(void*data){
  15. std::cout << "foo2" << std::endl ;
  16. }
  17.  
  18. int main(){
  19. Fm_show(foo2);
  20. foo();
  21. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
foo2