expected array behaviour

John Reimer terminal.node at gmail.com
Thu Jan 1 16:39:27 PST 2009


Hello Jarrett,

> If you want to modify the contents of string literals, like you're
> doing here, put a .dup on them.
> 
> char[] array1 = "ABCD".dup;
> 
> Again, modifying the contents of string literals is illegal and the
> results are undefined.
> 


Oh, right.  I missed that.

-JJR




More information about the Digitalmars-d-learn mailing list