fork download
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <string.h>
  4. void foo(void){
  5. printf("Jestem w funkcji foo");
  6. }
  7. typedef void (*fun_t)(void);
  8. int main(){
  9. fun_t *wsk;
  10. fun_t fun_wsk = foo;
  11. wsk = malloc(sizeof *wsk);
  12. memcpy(wsk, &fun_wsk, sizeof(fun_t));
  13. (*wsk)();
  14. free(wsk);
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0.01s 1852KB
stdin
Standard input is empty
stdout
Jestem w funkcji foo