back to arays

James Pelcis jpelcis at gmail.com
Mon May 15 13:19:20 PDT 2006


You can always "cheat" and do:

alias a b;

Max Samuha wrote:
> I thought array references are similar to object references like in C#
> (actually, thay are object references in C#) and that was my mistake:
> 
> int[] a = new int[20];
> int[] b = a;
> 
> a.length = 40; // a is copied and b is not updated to point to a's
> data;
> 
> Does it mean that anytime i change an array, i have to manually update
> all references to it or should i wrap my array in an Array class so
> that all references to any instance of that array remain valid?
> 
> If the question have been already discussed please refer me to the
> right thread. Thanks



More information about the Digitalmars-d-learn mailing list