It’s handy to catch potential exceptions in a bottom-down hierarchy: specific exceptions are handled first, then groups of exceptions and finally, a catch-all handler:
#include //std::except is the base class for most standard exceptions#include void main(){//...program bodycatch(std::bad_alloc& alloc_failure) { //handle exceptions thrown by operator new cout