Cpp exception handling

  • + 1 comment

    the invalid argument exception constructs the exception object (let's call it e) with what_arg as an explanatory string (this is it shows what went wrong) .This argument can be accessed by deault through the method what(). In other words we have the exception e and the method what().when we call e.what(); we get the message that shows what is wrong.