|
C Programming Reference >> C Programming Reference Question Bank >> 19/07/07 - 459 Views - Ratings : Question - What will be output of this C Code Snipet?
Answer - A = 3 B = 5 Explanation - Setjmp and longjmp are used to perform non - local goto operation. They dont work like normal goto for jumo but use stack values to trick compiler as if it was actually at that postion while compling. Settjmp act as label or target to jump and longjmp act as command to jump to that label. Now this jump has diffrent effects on volatile and non-volatile variables. Volatile Variable such as b will have its last value. Non Volatile Variable will lose its value and attain value it had at setjmp postion during compilation. Reader Comments -
|
|||||