if for some reason you can't use that ^^ the 2 main alternatives would be to make a bogus book to return or to return the array index as -1 for not found, index if found, make the finder int instead of book type, and then you can call THAT from a more public function that handles the -1 or index in a little wrapper for the user. And I guess you could throw and do try/catch, though I find abusing that for non errors to be a bit of a bad idea.