Array operations and 'Copy on Whatever'

Serg Kovrov kovrov at no.spam
Fri Aug 4 01:28:15 PDT 2006

* Frank Benoit:
> array_of_strings ~= tmp;
> copies the tmp array struct to the end of array_of_strings. Perhaps
> array_of_strings was new allocated and copied. But you did not copy the
> characters of tmp. The appended array still points to where tmp also
> points to.
> With delete tmp, you delete the characters. Here is the problem.

Thanks for explaining things, Frank. Appears I was run into a shallow 
copy issue.

More information about the Digitalmars-d-learn mailing list