[CPP] Try-Catch Clause
As java, we need a try-catch block in c++. The universal format of try-catch is try{ program-statements } catch (exception-declaration) { handler-statements } catch (exception-declaration) { handler-statements } //... Standard exception C++ standard library defines a set of classes which is used for exception. They are defined in the following 4 header files: exception: defines the most general kind of exception class. It communicates only that an exception occurred but provides no additional information. stdexcept: defines several general-purpose exception classes. new: defines the bad_alloc exception type. type_info: defines the bad_cast exception type stdexcept: exception: the most general kind of problem runtime_error: problems that can be detected only at run time range_error: runtime_error: result generated outside the range of values that are meaningful overflow_error: runtime_error: computation that overflowed underflow_error: runtime_error: comp...