fork download
  1. #include <stdio.h>
  2.  
  3. void quicksort(int (*comp)()){
  4. printf("%d\n",comp());
  5. }
  6.  
  7. int first()
  8. {
  9. return 1;
  10. }
  11.  
  12. int second(){
  13.  
  14. return 2;
  15. }
  16.  
  17. int main()
  18. {
  19. int a;
  20. a = 0;
  21. quicksort((int (*)())(a ? first : second)); /* !!!!!! */
  22. a = 1;
  23. quicksort((int (*)())(a ? first : second)); /* !!!!!! */
  24.  
  25. return 0;
  26. }
Success #stdin #stdout 0s 4440KB
stdin
Standard input is empty
stdout
2
1