fork(2) download
  1. #include <stdio.h>
  2. #include <stdbool.h>
  3.  
  4. typedef bool (*fnptr)(int);
  5. int lessThan = 100;
  6.  
  7. bool LessThan(int i);
  8. fnptr ptr = LessThan;
  9.  
  10. int main(void) {
  11.  
  12. printf ("%d\n", (*ptr)(90));
  13. lessThan = 50;
  14. printf ("%d\n", (*ptr)(90));
  15. return 0;
  16. }
  17.  
  18. bool LessThan(int i) {
  19. return i < lessThan;
  20. }
Success #stdin #stdout 0s 2168KB
stdin
Standard input is empty
stdout
1
0