All pastes #2057542 Raw Edit

Someone

public text v1 · immutable
#2057542 ·published 2011-05-12 18:38 UTC
rendered paste body
#include <stdio.h>
#include <stdlib.h>
#include <setjmp.h>


void a();
void b();
void c();

jmp_buf buf1,buf2,buf3;


void a()
{
	if(setjmp(buf1)==0)
		b();
	else
	{
		printf("\nin else of a\n\n");	
		longjmp(buf2,1);
	}

}

void b()
{
	c();	
}


void c()
{
	if(setjmp(buf2)==0)
	{
		printf("\nin if of c\n\n");
		longjmp(buf1,1);
	}
	else
	{
		printf("end");
		exit(0);
	}
}




int main()
{
	a();
	return 0;
}