Skip to content

Latest commit

 

History

History
32 lines (28 loc) · 539 Bytes

File metadata and controls

32 lines (28 loc) · 539 Bytes

exceptions

#include

  • std::logic_error
  • std::invalid_argument
  • std::runtime_error
  • std::range_error
  • std::length_error
  • std::domain_error
  • std::overflow_error
  • std::underflow_error
  • std::out_of_range

void foo() {     throw std::runtime_error("An error occured!"); } int main(int argc, char * argv []) {     try     {         foo();     }         catch (const std::exception& e)     {         std::cout << e.what() << std::endl;     }    

}