Exception handling syntax: Difference between revisions

Content deleted Content added
Python: file() is deprecated, the documentation recommends open()
C: C doesn't support exceptions. The provided code is just a possible workaround
Line 86:
=== C ===
{{Further information|C (programming language)}}
TheC mostdoes commonnot wayprovide todirect implementsupport to exception handling: init standardis Cthe isprogrammer's responsibility to useprevent [[setjmp.h|setjmp/longjmp]]errors in the first place and test return values from the functions:.
 
In any case, a possible way to implement exception handling in standard C is to use [[setjmp.h|setjmp/longjmp]] functions:
<syntaxhighlight lang="c">
#include <setjmp.h>