38 lines
406 B
C++
38 lines
406 B
C++
#include <iostream>
|
|
#include <exception>
|
|
|
|
struct A
|
|
{
|
|
int a;
|
|
int b;
|
|
|
|
A()
|
|
{
|
|
std::cout << "A::A()" << std::endl;
|
|
}
|
|
};
|
|
|
|
|
|
int main ( void )
|
|
{try{
|
|
|
|
A a[4];
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
catch ( const std::exception& e )
|
|
{
|
|
std::cerr << std::endl
|
|
<< "std::exception(\"" << e.what() << "\")." << std::endl;
|
|
return 2;
|
|
}
|
|
catch ( ... )
|
|
{
|
|
std::cerr << std::endl
|
|
<< "unknown exception." << std::endl;
|
|
return 1;
|
|
}}
|
|
|