Skip to content
UPEEC

Error Handling in C

C has no exceptions: functions return error codes, NULL or set `errno`.

Easy
Comments 0

Check every return value that can fail; propagate errors upwards; clean up resources on every path.

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.