C++ supports some standard exceptions that can be caught if we put the code inside the try block. These exceptions are a part of the base class “std:: exception”. This class is defined in the C++ header file <exception>.
Few Examples of Exceptions supported by this class include:
bad_alloc – thrown by ‘new’
runtime_error – thrown for runtime errors
bad_typeid – thrown by type id
Introduction to Standard Template Library