34      1.   -   C++?
cout  " = "  ptr_shape -> area();

 ,         
 square ():

class square : public rectangle {

public:

square(double h) : rectangle(h,h) { }
double area() { return (rectangle::area()); }

} ;

    ,    --, 
.

      .
      (   )  -
,     .    ( )   
      .  -
   ,        -
   ,    ,    .

1.10.   C++

C++    ,   . -
      try. , 
  catch,    try.

      throw.  -
    ,   , -
     try.    :

  stackex.cpp

//   

stack::stack(infc n)
{

if (n < 1)

throw (n);    //  

 = new char[n];//  

if (p == 0)      //new  0   
throw ("  ");

top = EMPTY;

max_len = n;

)

void g()
{

try {

stack a(n), b(n) ;

}