Error Handling
Peter da Silva
peter at ficc.ferranti.com
Sun Sep 30 04:23:14 AEST 1990
"Do you want to try door #1, door #2, or door #3?"
"Yes."
Door #1 (if(error) {cleanup; return;})
If cleanup is relatively small.
Door #2 (if(!error) {next_step;})
If there are relatively few cases, or you have religious reasons not
to use #3 (i.e., it's on an exam)
Door #3 (if(error) goto cleanup;)
If there are lots of cases and cleanup is nasty.
I've used all three.
--
Peter da Silva. `-_-'
+1 713 274 5180. 'U`
peter at ferranti.com
More information about the Comp.lang.c
mailing list