January 02, 2009 Re: expected array behaviour | ||||
---|---|---|---|---|
| ||||
Got it - so I should do this... const char[] array1= "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; char[] array2 = new char[array1.length]; and then copy the contents of array1 into array2. Regards, -=mike=- |
January 02, 2009 Re: expected array behaviour | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike James | On Thu, Jan 1, 2009 at 7:10 PM, Mike James <foo@bar.com> wrote:
> Got it - so I should do this...
>
> const char[] array1= "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
> char[] array2 = new char[array1.length];
Just "char[] array2 = array1.dup;"
.dup duplicates the array by creating a new array the same length and copying the data over.
|
Copyright © 1999-2021 by the D Language Foundation