1.

Which function restores the environment saved by the most recent invocation of the setjmp() macro in the same invocation of the program?(a) jmp_buf(b) longjmp(c) jmpbuf(d) long_jmpI got this question during an internship interview.Origin of the question is Non-Local Jumps topic in portion C Library of C

Answer»

Right OPTION is (b) LONGJMP

Explanation: longjmp() is the only function defined under the HEADER file SETJMP.h. What setjmp() does is save the contents of the registers so that longjmp() can restore the contents later.



Discussion

No Comment Found

Related InterviewSolutions