fork(1) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. typedef struct {
  5. void *(*fp)(int);
  6. } funcptr_wrapper;
  7.  
  8. void *returns_null(int i)
  9. {
  10. return NULL;
  11. }
  12.  
  13. int main(void)
  14. {
  15. funcptr_wrapper *w = malloc(sizeof *w);
  16. w->fp = &returns_null;
  17. printf("Return value: %p\n", w->fp(1337));
  18. free(w);
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 2424KB
stdin
Standard input is empty
stdout
Return value: (nil)