1 Mar
2003
1 Mar
'03
11:34 a.m.
jhr.walter@t-online.de writes:
But I needed to use
double *rdata = new double (n);
This dynamically creates one double object and initializes it with the value n and uses its address to intialize rdata.
... delete [] rdata;
And this tells the compiler to deallocate the dynamically allocated array rdata points to. Your program has undefined behavior. I haven't followed this thread, but the code you posted here definitely looks very fishy.