fork(1) download
  1. #include <iostream>
  2.  
  3. typedef bool(*validateFcn)(int, int);
  4.  
  5. bool SomeValidateFunction(int a, int b)
  6. {
  7. return a > 0 && b > 0;
  8. }
  9.  
  10. bool validate(int nX, int nY, validateFcn pfcn)
  11. {
  12. if(pfcn(nX,nY)) printf("Valid");
  13. }
  14.  
  15. int main()
  16. {
  17. validate(1, 1, SomeValidateFunction);
  18. return 0;
  19. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
Valid