back to arays

Max Samuha maxter at i.com.ua_spamless
Mon May 15 00:05:22 PDT 2006


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