Boost logo

Boost Users :

From: jhr.walter_at_[hidden]
Date: 2003-03-05 02:15:52


Hi Thomas,

you wrote:

> > 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.

Here's the original code:

  double *rdata = new double[n]; // stores non-contigous part of the current
row of A

> > ...
> > 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.

Thanks for the correction and sorry for the confusion,

Joerg


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net