        unexpected()  terminate()    
   . ,   
  unexpected()      
      .  
       .   
   terminate()       
  ,  ,     
    . 
      abort()   .   abort()   
     "", ""  " -". 

      unexpected()  terminate() 

         -  
     set_unexpected(), 
    EXCEPT. H.     
unexpected_function,       . 
           
 ,      catch   
 ,     . 
         -  
    set_terminate(),    
  ..     terminate_function,  
     . 
       set_unexpected()  set_terminate()    
 -.       
 ,     ,     
 . ,    -: 

    void unexpectedHandler(); 

     , ,    (   
 ).       : 

    set_unexpected(unexpectedHandler); 

        ,      
-,    : 

    unexpected_function savedAdress;	//    
    savedAdress = set_unexpected(unexpectedHandler);	//   
    // ...      	-. 
    set_unexpected(savedAdress);    //    
    // ...      

      terminate()  ,  
 set_unexpected()   set_terminate(),   
 terminate_function. 
      15.18     
   .     
       
,        
.         DOS- 
 Easy Win-. 

     15.18.  UNEXPECT.CPP ( - unexpected()  terminate()) 

    1:	#include <iostrearo. h> 
    2:	#include <except.h> 
    3: 
    4:	#define MAXERR 10 
    5: 
    6:	// , ,      
    7:	class HaxError 
    8:	{ 
    9:	);
    10: 
    11:	//     
    12:	class Error {      
    13:	public:      
    14:	  Error();    // 
    15:	  void Say();  // ,     
    16:	private: 
    17:	  static int count; //      /      ' 
    18:	}; 
    19:	
    20:	//  ,   ..; , 
    21:	void Run() throw(Error);                        
    22:	void trapper(); 


    412      III.   ANSI C++ 
