Given a function that returns a value, is it possible to exit the function given a certain condition without returning anything? If so, how can you accomplish this?
Example:
int getNumber ()
{
. . .
}
So say you are in this function. Is there a way to exit it without it doing anything?
You have two options:
returnsomething orthrow.If you
throw, you have tocatchthe type you threw.