Use jmp_buf in multiple file
问题 For clearly, please view my sample I have two files: main.cpp and myfunction.h This is main.cpp #include <setjmp.h> #include <myfunction.h> int main() { if ( ! setjmp(bufJum) ) { printf("1"); func(); } else { printf("2"); } return 0; } This is myfunction.h #include <setjmp.h> static jmp_buf bufJum; int func(){ longjum(bufJum, 1); } Now, I want my screen print "1" and then print "2", but this code is uncorrect! Please, help me! Thank you so much! 回答1: If you want to have it in multiple files,