Hi!
ClassA c1, c2;
c1.bChanged=false;
c2.bChanged=false;
XYArray* arr = new XYArray;
arr->Add(c1);
arr->Add(c2);
ClassA itemA = arr->Item(0);
itemA.bChanged=true;
arr->Item(0).bChanged = true;
While itemA is a new object, the line arr->Item(0).bChanged = true; uses a reference to the object in the array as an lvalue and stores the correct value.
upcaseupCASE ----------------------------------- If it was hard to write, it should be hard to read!- Do. Or do not. There is no try! |