I was thinking today about the try/catch blocks existent in another languages. Googled for a while this but with no result. From what I know, there is not such a thing as try/catch in C. However, is there a way to “simulate” them?
Sure, there is assert and other tricks but nothing like try/catch, that also catch the raised exception. Thank you
I was thinking today about the try/catch blocks existent in another languages. Googled for
Share
C itself doesn’t support exceptions but you can simulate them to a degree with
setjmpandlongjmpcalls.This website has a nice tutorial on how to simulate exceptions with
setjmpandlongjmp