try

1. do not need exception message

try
{
    // 
}
catch (...)
{
    //
}

2. need exception message

try
{
    //
}
catch (const std::exception& e) // reference to the base of a polymorphic object
{
    std::cout << e.what(); // information from length_error printed
}
posted @ 2022-12-22 18:18  shendawei  阅读(33)  评论(0)    收藏  举报