     15.15.  PERSIST.CPP (    ) 

    1:	#include <iostream.h> 
    2:
    3:	class TPersist { 
    4:	private: 
    5:	   int x, y; 
    6:	public: 
    7:	   TPersist(int a,  int b) { x = ;   = b;   }              //  
    8:	   ~TPersistO { x = 0;   = 0;  }                             //  
    9:	   void *operator new(size_t,  void *p) {  return p;   } 
    10:	   friend ostream& operator (ostream &os, TPersist &p); 
    11:	}; 
    12: 
    13:	char object[sizeof(TPersist)]; 
    14: 
    15:	main() 
    16:	{ 
    17:	  TPersist *p = new(object) TPersist(10,   20); 
    18:	  cout  *p  endl; 
    19:	  cout  "Address of object == "  tobject  endl; 
    20:	  cout  "Address of *p        == "  &(*p)  endl; 
    21:	  p->TPersist::~TPersist();                                        //    
    22:	  //    p->TPersist();                                                        //   ++  4.0;     3.1 
    23:	  return 0; 
    24:	} 
    25: 
    26:	ostreamS operator (ostreamS os, TPersist &p) 
    27:	{ 
    28:	  os  "x == "  p.x  ",   == "  p.; 
    29:	  return os; 
    30:	}
 
      TPersist  new   .  
     ,     
    void.     17  new 
     TPersist   , 
   13.  new(object)   
- ,      object. 
   new     
 ,        
    ,      
TPersist   ,    . 
          object    
.   ,       
 . 
        PERSIST   Turbo Debugger. 
    object       
  <F8>.    17  ,    
   10  20;  ,   -: 
 new        . 
      21     ,  . 
     ,   
         
   .     
      : 

    p->TPersist::~TPersist();     //    

    C++     ,   ,   
    .  ,   
     Turbo Debugger.    , 
 ,        - 
 ( 8  21). 
      ,       
,      : 

    p->TPersist();	//    

     Borland C++3.1    .	


    15.   C++     397 
