In a function that has multiple exit points, and also has multiple dynamically allocated variables, I could repeat all the necessary delete statements before every return statement (if I remember), or I could put an Exit: label followed by all of the deletes at the end of the function and simply (![]()
) goto Exit at the various exit points. I'm thinking that the latter seems more efficient, more readable, and easier to maintain, and that therefore this is one of those "rare" situations in which goto is appropriate. Any comments?



LinkBack URL
About LinkBacks





