206                                             7. Ad hoc 

  string7.cpp

my_string my_string::operator^(my_string& a)
{

if (this != &a) { //  = ,   
if (a.len != len) { //  ?
delete [ ] s;

len = a.len;

s = new char[len + 1] ;

assert (s != 0) ;

}
strcpy(s, a.s); //   

}
return *this;

7.8. :       

      ,     -
,   .' ,    ,  
 .       , 
,    ,   +, -, *  /,  
  .  ,  ,   -
 , ,      -
  C++.    ,   -
,      .   
  ,      .

         -
 6.9,    ,  . 174.    -
 :

  12.

//    

class polynomial {
public:

polynomial() ;

polynomial(const polynomials p) ;

polynomial(int size, double coef[], int expon[]);

-polynomial() { release(); }

void print() const ;

double operator()(double x) const; // ()

polynomial& operator=(const polynomial& a);

friend polynomial& operator+(const polynomial& a,
const polynomial& b) ;

         ,  
  .  . .