fork download
  1. #include <stdio.h>
  2.  
  3. void func(int m, int n) {
  4. printf("\tDo nothing good! %d\n", m + n);
  5. }
  6.  
  7. int main(void) {
  8. printf("Before:\n");
  9. func(1000, 2000);
  10. printf("Allowable operations:\n");
  11. ((void (*)(void))func)();
  12. ((void (*)(void))&func)();
  13. ((void (*)(void))*func)();
  14. ((void (*)(void))**func)();
  15. /*((void (*)(void))&&func)(); // no consecutive address-of, but logical*/
  16. ((void (*)(void))&*func)();
  17. ((void (*)(void))*&func)();
  18. ((void (*)(void))&**func)();
  19. ((void (*)(void))**&func)();
  20. ((void (*)(void))*&**&***&func)();
  21. ((void (*)(void))&*&**&***func)();
  22. printf("After:\n");
  23. func(-1, -2);
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
Before:
	Do nothing good! 3000
Allowable operations:
	Do nothing good! 0
	Do nothing good! 0
	Do nothing good! 0
	Do nothing good! 0
	Do nothing good! 0
	Do nothing good! 0
	Do nothing good! 0
	Do nothing good! 0
	Do nothing good! 0
	Do nothing good! 0
After:
	Do nothing good! -3