Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Dijkstra...

Name: Anonymous 2010-09-13 16:49

...is my real homeboy.
Edsger Dijkstra is flawless and sometimes I wish /prog/ could understand him.

Name: Anonymous 2010-09-13 18:06

I use goto mostly for this kind of thing:
/* ... */
if (!(ptr = malloc (size)) goto fail_malloc;
if (!(fh = fopen (some_file))) goto fail_fopen;
if (some_other_thing_that_can_fail (foo) != bar) goto fail_some_more;
/* ... */
return success;
fail_some_more:
    fclose (fh);
fail_fopen:
    free (ptr);
fail_malloc:
    clean_up (previous shit);
return failure;

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List