    22:	  cout  "TRUE"  endl;   
    23:	else               
    24:	  cout  "FALSE"  endl;	
    25:		
    26:	//      	
    27:	cp->Add(new string("Tip")); 
    28:	cp->Add(new string("Toe")); 
    29:	cp->Add(new string ("Through"));	
    30:	cp->Add(new string("The"));	
    31:	cp->Add(&s); // ! ! ! ! ! !   
    32:	ShowMe("Original array: ", *cp);	
    33: 
    34:	//         
    35:	cp->Detach(2, TShouldOelete::Delete);  
    36:	ShowMe("After Detach(2, Delete)", *cp);  
    37: 
    38:	//    ,        
    39:	cp->Detach(&s, TShouldDelete::NoDelete);           
    40:	ShowMe("After Detach(&s, NoDelete)", *cp); 
    41: 
    42:	//    , ,  	
    43:	int n = cp->GetItemsInContainer();	
    44:	cp->Detach(n - 1, TShouldDelete::DefDelete);	
    45:	ShowMe("After Detactj(n - 1, DefDelete)", *cp);	
    46: 
    47:	//     , , ,   
    48:	Cp->Flush(); 
    49:	ShowMe( "After Flush()", *cp);	
    50:		
    51:	//  .   ???	
    52:	delete cp; 
    53:		
    54:	return 0;     
    55:	}             
    56: 
    57:	//    ,    
    58:	void ShowMe(const char *msg, TContainer &cr) 
    59:	{ 
    60:	TIterator iterator(cr); //     
    61:	string *sp;          //     
    62: 
    63:	cout  endl  msg  endl;         //   
    64:	cout  "Items in container = ";       //  	
    65:	cout  cr.6etItemsInContainer()  endl; //    
    66:	while ((sp = iterator++) != 0)       //    
    67:	  cout  " "  *sp;              //  	
    68:	cout  endl;                   //   
    69:	}
 
             
 .  TContainer     , 
   .  TIterator     
.       TContainer,    
 new   :	

    TContainer cp; 
    cp = new TContainer(10,  0,  10);	

        ,   ,  
 ,   (  ),   
       :	

    cp->Add(new string("Tip")); 

     ,        
 s,    :	

    cp->Add(&s);    // !!!	

       ,      . , 
          
,     ,   , 
    .   ,     
   .      
      ,   
            , 
   .	


     16.    Borland	435 
