expected array behaviour

Stewart Gordon smjg_1998 at yahoo.com
Fri Jan 2 03:05:21 PST 2009


Mike James wrote:
<snip>
> const char[26] array1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
> char[26]  array2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
> 
> It doesn't occur. Is this expected behaviour?

Yes.  Static arrays have value semantics, unlike dynamic arrays, which 
have reference semantics.

Stewart.


More information about the Digitalmars-d-learn mailing list