I was wondering if this is safe to do ...
delete p_pointer;
p_pointer = p_otherPointer;
Instead of...
delete p_pointer;
p_pointer = 0;
p_pointer = p_otherPointer;
I would suggest so, as there are no new memory allocations between deletion and assignment, but I just want to make sure.
source
share