fork download
  1. #include <cstdio>
  2. #include <cstdlib>
  3. #include <iostream>
  4. #include <exception>
  5. using namespace std;
  6.  
  7. int main( void )
  8. {
  9. set_unexpected( []{ puts( "unexpected" ); fflush( stdout ); throw 0; } );
  10. set_terminate( []{ puts( "terminate" ); fflush( stdout ); abort(); } );
  11. puts( "main" );
  12. []() throw( exception ) { throw 0; }();
  13. }
  14.  
Runtime error #stdin #stdout 0s 2960KB
stdin
Standard input is empty
stdout
main
terminate