fork download
  1. #include <stdio.h>
  2. #include <setjmp.h>
  3.  
  4. jmp_buf jb;
  5. int i;
  6.  
  7. int main(void) {
  8. i = 0;
  9. setjmp(jb);
  10. printf("%d\n", i);
  11. i++;
  12. if (i < 10) longjmp(jb, 1);
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 4368KB
stdin
Standard input is empty
stdout
0
1
2
3
4
5
6
7
8
9