- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
#include <iostream>
#include <stdexcept>
using namespace std;
class Exception : std::runtime_error
{
public:
Exception( std::string const & what ) : std::runtime_error(what)
{
}
};
int main( )
{
try
{
throw Exception("Exception");
}
catch ( std::exception const & e )
{
std::cerr << e.what() << std::endl;
}
catch(...)
{
std::cerr << "..." << std::endl;
}
return 0;
}