Mail Archives: djgpp/1999/04/13/22:15:32
In article <199904132318 DOT TAA05382 AT envy DOT delorie DOT com>,
djgpp AT delorie DOT com wrote:
>
> > double *ptr2= new double [size+1];
> > ...
> > delete [] ptr;
>
> I hope you meant ptr2 here.
>
> > double *ptr=new double [size];
> > ...
> > delete [] ptr2;
>
> I hope you meant ptr here.
I don't think so (or at least I hope not). The idea is to increase the size
of the array ptr by one, so I copy to a dummy array, delete ptr and recreate
it with a new, larger size. Then copy the old contents across from the dummy
array and delete it.
I am quite new to this however :)
--
Chris Jones
"Everybody who believes in psychokinesis, raise my right hand"
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
- Raw text -