home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a120 / 1.ddi / WATCOM_C / WAT113.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-07  |  675 b   |  30 lines

  1. /*------------------------------------------------------------------*/
  2. /* ╡{ªí└╔ªW║┘: wat113.c                                             */
  3. /*------------------------------------------------------------------*/
  4. #include <stdio.h>
  5. #include <process.h>
  6. #include <setjmp.h>
  7. jmp_buf env;
  8.  
  9. void subprocess()
  10. {
  11.    longjmp(env,10);
  12. }
  13.  
  14. void main()
  15. {
  16.    int value;
  17.  
  18.    value = setjmp(env);
  19.    if (value != 0)
  20.    {
  21.        printf("Longjmp with value %d\n", value);
  22.        exit(value);
  23.    }
  24.        printf("After setjmp %d\n",value);
  25.        printf("About to call subprocess ... \n");
  26.        subprocess();
  27.        printf("Longjmp with value %d\n",value);
  28. }
  29.  
  30.