jmp_buf - C setjmp.h

C examples for setjmp.h:jmp_buf

type

data type

Type to hold information to restore calling environment

From

<setjmp.h>
<csetjmp>

Description

This is an array type storing the information of a calling environment to be restored later.

Demo Code


#include <stdio.h>
#include <setjmp.h>

int main()//from   w  w w.j a  v a  2 s.  c  o m
{
  jmp_buf env;
  int val;

  val=setjmp(env);

  printf ("val is %d\n",val);

  if (!val) 
     longjmp(env, 1);

  return 0;
}

Related Tutorials