Appending to multidimensional dynamic array

kerdemdemir via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat May 30 23:15:10 PDT 2015


> In your case its pretty simple. The buffer is being reused. So 
> same memory being added multiple times to the candidate.
> Just slap on a .dup when adding it.

>>         candidate ~= line;


Thanks a lot replacing the line above with

candidate ~= [line[0].dup, line[1].dup];

My problem is solved .


More information about the Digitalmars-d-learn mailing list