|
|
|
|
|
by etal
6067 days ago
|
|
It's common in C where functions return an error code instead of a value that you would use again. Then the conditional just checks that you're OK to go ahead, and you don't need to declare another variable to store the error code. (If a language has exceptions, then this isn't as useful.) |
|
if ( !method_returns_rc( args ) ) { //error handle }
This isn't great, as I believe its not good to put methods with side effects in if statements (may be wrong here, or maybe its just me), but generally thats how its done (not to say that there aren't freaking GOTOs in our code... so take that with a grain of salt.)