devxlogo

November 27, 2000

Returning a Value from a Function that Throws

A reader asked me the following questions: “Can a function that returns something, throw a exception and still return a value?” Lets’ look at a concrete example: int f(){ if