Skip to content

Instantly share code, notes, and snippets.

@acmorrow
Created January 21, 2013 20:49
Show Gist options
  • Save acmorrow/4589211 to your computer and use it in GitHub Desktop.
Save acmorrow/4589211 to your computer and use it in GitHub Desktop.
error_or: return codes example
// Error handling with return codes
Status makeAFoo(Foo** result, int param1, int param2);
Foo* newFoo = NULL;
Status s = makeAFoo(&result, 42, 0);
if (s) {
// use newFoo
} else {
// handle error
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment