expected array behaviour

John Reimer terminal.node at gmail.com
Thu Jan 1 15:28:12 PST 2009


Hello Mike,

> I have a function that uses 2 array strings defined similar to this...
> 
> const char[] array1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; char[]  array2 =
> "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
> 
> If I make a change to a char in array1 it also changes the same in
> array2. But if I define the arrays as follows...
> 
> const char[26] array1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; char[26]  array2
> = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
> 
> It doesn't occur. Is this expected behaviour?
> 
> Regards,
> -=mike=-


Wha?!  If that's true, that looks like a nasty bug!

Is that dmd v2 or v1? Linux or Windows?

-JJR




More information about the Digitalmars-d-learn mailing list