1.

How many times can the macro setjmp() return?(a) one time(b) two times(c) three times(d) many timesI had been asked this question in class test.The question is from Non-Local Jumps topic in section C Library of C

Answer»

The correct choice is (b) two times

Easiest explanation - SETJMP() macro returns twice. FIRST time, setjmp() returns ZERO on its DIRECT invocation. Second time macro returns when longjmp is called with the information written to the environment; now, it returns the VALUE passed to longjmp as second argument.



Discussion

No Comment Found

Related InterviewSolutions