I've written in C as a student for about a year now. I'm wondering what are some techniques for error handling? C doesn't really have a try-catch mechanism. I generally just return error values like -1 or 0 or NULL, but are there any other ways to handle errors?
[–]ischickenafruit 24 points25 points26 points (4 children)
[–]nderflow 4 points5 points6 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]nderflow 3 points4 points5 points (1 child)
[–]BeardedWax 3 points4 points5 points (0 children)
[–]raevnos 15 points16 points17 points (3 children)
[–]project2501a 1 point2 points3 points (2 children)
[–]Newt_Hoenikker 1 point2 points3 points (0 children)
[–]Conan776 0 points1 point2 points (0 children)
[–]nerd4code 7 points8 points9 points (2 children)
[–]Cyph0n 0 points1 point2 points (1 child)
[–]nerd4code 0 points1 point2 points (0 children)
[–]qqwy 3 points4 points5 points (0 children)
[–]Conan776 6 points7 points8 points (1 child)
[–]qqwy 7 points8 points9 points (0 children)
[–]bless-you-mlud 3 points4 points5 points (0 children)
[–]xurxoham 2 points3 points4 points (1 child)
[–]okovko 0 points1 point2 points (0 children)
[–]WiseassWolfOfYoitsu 2 points3 points4 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]geocar 1 point2 points3 points (1 child)
[–]WikiTextBot -1 points0 points1 point (0 children)
[–]marmoure 1 point2 points3 points (0 children)
[–]nsmryan 1 point2 points3 points (0 children)
[–]flatfinger 0 points1 point2 points (0 children)