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