fork download
  1. #include <stdio.h>
  2.  
  3. typedef int (*myType)(int);
  4.  
  5. int addFive(int seed)
  6. {
  7. return seed + 5;
  8. }
  9.  
  10. void PrintInt(int number, myType HandleFunc)
  11. {
  12. int resultValue = HandleFunc(number);
  13. printf("%d\r\n", resultValue);
  14. }
  15.  
  16. int main(void) {
  17. int value = 10;
  18. myType myFunc = addFive;
  19. printf("%d\r\n", (*myFunc)(value));
  20. PrintInt(value, addFive);
  21. PrintInt(value, &addFive);
  22. // your code goes here
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0s 2112KB
stdin
Standard input is empty
stdout
15
15
15