Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
CObArray::RemoveAll
CObArray                                    Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  void RemoveAll();
 
  Remarks
 
  Removes all the pointers from this array but does not actually delete
  the CObject objects. If the array is empty already, the function still
  works.
 
  The RemoveAll function frees all memory used for pointer storage.
 
  Example
 
  CObArray array;
  CAge* pa1;
  CAge* pa2;
 
  array.Add( pa1 = new CAge( 21 ) ); // Element 0
  array.Add( pa2 = new CAge( 40 ) ); // Element 1
  ASSERT( array.GetSize() == 2 );
  array.RemoveAll(); // Pointers removed but objects not deleted
  ASSERT( array.GetSize() == 0 );
  delete pa1;
  delete pa2;  // Cleans up memory
 
 
 
                                     -♦-