在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
1 #include <iostream> 2 #include <iomanip> 3 #include <string> 4 #include <sstream> 5 #include <fstream> 6 #include <memory> 7 #include <cstdlib> 8 9 10 int main(int argc, char *argv[]) 11 { 12 13 try 14 { 15 throw std::range_error("Hello Wolrd"); 16 17 } catch (std::range_error e) 18 { 19 std::cout << e.what() << std::endl; 20 abort(); 21 } catch (std::underflow_error e) 22 { 23 std::cout << e.what() << std::endl; 24 abort(); 25 } catch (std::overflow_error e) 26 { 27 std::cout << e.what() << std::endl; 28 abort(); 29 } catch (std::length_error e) 30 { 31 std::cout << e.what() << std::endl; 32 abort(); 33 } catch (std::out_of_range e) 34 { 35 std::cout << e.what() << std::endl; 36 abort(); 37 } catch (std::invalid_argument e) 38 { 39 std::cout << e.what() << std::endl; 40 abort(); 41 } catch (std::domain_error e) 42 { 43 std::cout << e.what() << std::endl; 44 abort(); 45 } catch (std::runtime_error e) 46 { 47 std::cout << e.what() << std::endl; 48 abort(); 49 } catch (std::logic_error e) 50 { 51 std::cout << e.what() << std::endl; 52 abort(); 53 } catch (std::bad_cast e) 54 { 55 std::cout << e.what() << std::endl; 56 abort(); 57 } catch (std::bad_alloc e) 58 { 59 std::cout << e.what() << std::endl; 60 abort(); 61 } catch (std::exception e) 62 { 63 std::cout << e.what() << std::endl; 64 abort(); 65 }catch(...) 66 { 67 std::cout<<"This fuck"<<std::endl; 68 } 69 70 return 0; 71 }
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论