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