I've stumbled on articles here and here, that says its good programming practice to never return NULL. But for functions that need to return something, what should it return? a value of -1
is not going to cut it since lets say we have function:
char *return_some_string(int input) {
/* do something */
if (error)
return some_thing_not_null;
}
How do you get round this problem?