fork download
  1. #include <stdio.h>
  2. #include <stdbool.h>
  3.  
  4. void func(int arg, bool useReturn)
  5. {
  6. printf("func(%d,%d);\n", arg, useReturn);
  7. if(arg == 1)
  8. {
  9. printf("arg is 1\n");
  10. if(useReturn)
  11. return;
  12. }
  13.  
  14. if(arg != 1)
  15. {
  16. printf("arg isn't 1 - %d\n", arg);
  17. }
  18.  
  19. if(useReturn)
  20. return;
  21.  
  22. printf("I'm last statement in function.\n");
  23.  
  24. }
  25.  
  26. int main(void) {
  27. func(1, true);
  28. func(2, true);
  29.  
  30. func(1, false);
  31. func(2, false);
  32.  
  33. return 0;
  34. }
  35.  
Success #stdin #stdout 0s 2292KB
stdin
Standard input is empty
stdout
func(1,1);
arg is 1
func(2,1);
arg isn't 1 - 2
func(1,0);
arg is 1
I'm last statement in function.
func(2,0);
arg isn't 1 - 2
I'm last statement in function.