3 ms·
If anyone is curious, it's not just used to make unreadable spaghetti code. There are certain common paradigms, eg. int do_stuff_in_order(void) { int r
by ghostpepper 4y ago
If anyone is curious, it's not just used to make unreadable spaghetti code. There are certain common paradigms, eg.
int do_stuff_in_order(void) {
int ret = init_a();
if (ret != success) goto out;
ret = init_b();
if (ret != success) goto error1;
ret = init_c();
if (ret != success) goto error2;
return 0;
error2:
teardown_b();
error1:
teardown_a();
out:
return ret;
}