fork download
  1. #include <stdio.h>
  2.  
  3. int add(int a, int b) {
  4. return a + b;
  5. }
  6.  
  7. int (*ptrAdd)(int, int);
  8.  
  9. int main() {
  10. ptrAdd = add;
  11. printf("a + b = %d\n",ptrAdd(1,2));
  12. return 0;
  13. }
Success #stdin #stdout 0s 4912KB
stdin
Standard input is empty
stdout
a + b = 3