octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gplot.txt


From: Lachlan Andrew
Subject: Re: gplot.txt
Date: Fri, 4 Mar 2016 17:26:22 +1100

On 4 March 2016 at 16:37, Daniel J Sebald <address@hidden> wrote:

> assign memory even from the start--not a bad strategy.  However, at that
> point, the member pointers r and d are initialized as r(0) and d(0).  And
> 2)
>       delete [] r;
>
> Now, the first line of code is more questionable.  Typically one isn't
> supposed to delete a NULL pointer.

Good catch, but deleting NULL pointers is valid in all
standards-compliant compilers, and some people advocate that rather
than checking for NULL first.  See the discussion at

http://stackoverflow.com/questions/4190703/is-it-safe-to-delete-a-null-pointer#4190737

Cheers,
Lachlan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]