Array & Assignement - Question
Posted on 2006-05-24
Dim A(20), B(20), C(), D As Integer
For D = 0 To 19
A(D) = 3
B(D) = 4
MsgBox(A(1) & vbTab & B(1)) 'Outputs 3 4
C = A
A = B
B = C
MsgBox(A(1) & vbTab & B(1)) 'Outputs 4 3
What exactly is happening during the C = A, A = B, B = C stage?
Are A, B, and C references to separate array objects that contain integers (originally)?
So, C = A makes C and A both point at the Array Object containing 20 3's, correct?
A = B changes the integer-array-reference, A, to point to the array containing 20 3's, correct?
Thanks, this is a little fuzzy to me in VB (whereas it is very eplicit how such things work in C++)