I am new to C and come from a back ground of newer languages (like Java and C++) and I'm not sure how to handle runtime errors like an incorrect arguments sent to a function.
for example say I want to write a function to manipulate a string (assuming any valid int is an acceptable return value):
int foo (char s[]) {
if ( strlen(s) < 1)
// ERROR
....
....
return someInt;
}
How do I handle this scenario in Ansi C if I want the function to stop immediately? In C++ or Java I would throw an exception to be caught by the caller.