      

       new     
  .  12.11 ,   .

     12.11. NEWSTR.CPP (    new)

    1:	#include <iostream.h>
    2:
    3:	#define SIZE 80
    4:
    5:	main()
    6:	{
    7:
     8.	  char *sp
    . 9:	  sp = new char[SIZE];
    10;	  cout 	"String?";
    11:	  cin.getlinefsp, SIZE);
    12:	  cout  "You entered:"  sp  '\n';
    13:	  delete[]	sp;
    14:	  return 0
    15:	}

     9     SIZE    
     sp.  10-12  
 ,     .
     13    . Borland C++ 
      :

    delete sp; // ???,    Borland C++

        C++,    
  delete[],  ,   ,  
 . ( Borland C++      , 
   ,    .)
       C++       
.  C++  2.0, ,  15    delete(SIZE]
sp;. Borland C++  SIZE       
    delete.

      

    ,       ,   ,  new 
delete        
  ,     .  12.12  .

     12.12. NEWARRAY.CPP (    new)

     1:     #include <iostream.h>
     2:
     3:     #define COUNT 100 //   
     4:
     5:     main()
     6:     {
     7:     int *array; //   
     8:     int i; //  
     9:
    10:     array = new int[COUNT];
    11:
    12:     //  
    13:     for (i = 0;  i < COUNT;  i++)
    14:     array[i] = i;
    15:
    16:     //   
    17:     for (i = 0;  i < COUNT;  i--) {
    18:       cout.width(e);
    19:       cout  arrayfi];
    20:     }
    21:     delete[] array;
    22:     return 0;
    23:     }

         7      .
  10  new     100  . 
    0  99   


     12.   C++     293 
