Nokia Interview Test + exception constructor

This commit is contained in:
2013-09-24 00:28:00 +04:00
parent 13281ad9b9
commit 5a641b91ec
10 changed files with 348 additions and 370 deletions

View File

@@ -0,0 +1,37 @@
#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;
}}