home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / msdos / pascal / rehack / contain / array.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1991-06-01  |  424 b   |  28 lines

  1. #include "array.h"
  2.  
  3. typedef containable *containable_ptr;
  4. array::array(int s)
  5.  {
  6.   int i;
  7.  
  8.   t_size = s;
  9.   data = new containable_ptr[s];
  10.   i = s;
  11.   for (i = 0; i < t_size; i++)
  12.     data[i] = NULL;
  13.  }
  14.  
  15. array::~array()
  16.  {
  17.   int i;
  18.   for (i = 0; i < t_size; i++)
  19.     if (data[i] != NULL)
  20.       delete data[i];
  21.   delete data;
  22.  }
  23.  
  24. void array::put(containable *arg)
  25.  {
  26.   data[object_count++] = arg;
  27.  }
  28.