A
alan
Dear all,
I am a newbie in C++.
If I want to allocate memory to objects, I will use double *d = new
double[10] instead of ANSI-C malloc.
But if I want to resize, say enlarge num of objects to 20, how can I
do it?
In ANSI-C, I can use realloc to do this.
I also try that.
double *d = new double[20];
but my pervious 10 double value is cleared....I want to keep the
pervious value and enlarge the size.
Please help. If possible, pls give me some simple examples.
Thank you very much.
Alan
I am a newbie in C++.
If I want to allocate memory to objects, I will use double *d = new
double[10] instead of ANSI-C malloc.
But if I want to resize, say enlarge num of objects to 20, how can I
do it?
In ANSI-C, I can use realloc to do this.
I also try that.
double *d = new double[20];
but my pervious 10 double value is cleared....I want to keep the
pervious value and enlarge the size.
Please help. If possible, pls give me some simple examples.
Thank you very much.
Alan