Practical usage of setjmp and longjmp in C

前端 未结 8 1779
忘了有多久
忘了有多久 2020-11-28 01:48

Can anyone explain me where exactly setjmp() and longjmp() functions can be used practically in embedded programming? I know that these are for err

8条回答
  •  囚心锁ツ
    2020-11-28 02:22

    Apart from error handling, the other thing that you can do and was not previously mentioned is to implement tail rectursive computation in C in a smart way.

    This is actually how are implemented the continuations in C without converting the input code in continuation passing style.

提交回复
热议问题