reallocating memory in efficient way
<p>A new, presumably larger block, can be obtained and initialized with the old block, and then the old block 
be freed.</p>

<pre><code>purpose of that code ; reallocating the old memory area with new size

typeName is  Object 

Object *oldArray = objects ; // objects is pointer to old data block 
objects = new Object[ newCapacity ] ;
for ( int k = 0; k &lt; theSize ; k++ ) 
    objects [k] = oldArray [k] ;
... // some other thing 
delete [] oldArray ;
</code></pre>

<p>Are there any other way to do that job, <strong>efficiently</strong> ?</p>
