Is it good programming practice to use setjmp and longjmp in C?

前端 未结 8 1909
误落风尘
误落风尘 2021-02-07 10:28

I\'m a C++ programmer and used to OO languages with good exception handling.

From what I can understand, setjmp and longjmp are essentially a c-style way to propogate ex

8条回答
  •  忘了有多久
    2021-02-07 11:26

    You certainly don't want to use setjmp in C++, as you say that's what exceptions are for. You don't want to use them in C either because it's exceedingly hard to get right. Try very hard to find other solutions.

提交回复
热议问题