Can't understand if deallocation happens?

Suliman via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jan 22 05:34:10 PST 2017


> You do not append to anything, only overwrite it. There is no 
> reallocation because
> "aaa".length == "bbb".length.

I changed my code to:
   str_ptr.length +=1;
   str[] = "bbbb"[];

But now it's print length 4 before and after writing "bbb" to 
`str`. I expected that size will be 3+4=7.


More information about the Digitalmars-d-learn mailing list