8.4.                                        233

~my_string() ;

void assign(const my_string& str);

void print() consfc { cout  st -> s ; }

my_string& operator=(my_string& str)
{ assign(str); return sfcr; }

friend class string_iterafcor;

friend ostream&

operator(ostream& out, const my_string& str);

private:

str_obj* st;

};

//   my_string
//" "     
//   
//ostream_epeea  _,
//-  my_string .

ostream& operator(ostream& out,const my_string& str)
(

out  str.st -> s;

return out ;

}

  , ostream& operator (ostream& , const my_stringSc)
     str_obj.    -
    my_st r ing.       -
-,        ostream.  -
     ostream&,     
   .    -
 iostream.h.

- assign ()     operatcr=().
      .
 ,       ,  
           .

 -   .    ,
        -
 my_string* ptr_s.     -
 cur_ind.     my_st r ing  str_obj
 ,    ,   string_iterator  -
 str_obj.

  strings, h

class string_iterator {
public:

string_iterator(my_string& s) : cur_ind(0),ptr_s(&s){ }

bool successor();

char& item() { return ((ptr_s -> st -> s)[cur_ind]); }