#include #include #include #include using namespace std ; int divide( int dividend, int divisor ) { if ( divisor == 0 ) throw string( "Divisor is 0." ) ; return dividend/divisor ; } int main() { try { thread th1 ( divide, 5, 0 ) ; th1.join() ; } catch( string& messg ) { cout << "Catch handler in main: " << messg << endl ; } cout << "Main:" << endl ; return 0 ; }