R
Russell
This is got to be an easy one - but since I am new.
How to make sure you are passing the reference to a new array not the same
one.
When I change the array for item1 it also affects item2
I have a 2 classes:
class A
{
float[] mArray;
public float[] mArray
{
get { return this.mArray;}
set { this.mArray = value;}
}
}
class B
{
List<A> myA = new List<A>();
public B()
{
myA.Add(new A());
myA.Add(new A()); // I expect to now have two objects, each
with an array mArray.
}
//need help here also - how to get based on index in list
public float[] mArray0
{
get { return myA[0].mArray}
}
public float[] mArray1
{
get { return myA[1].mArray}
}
}
How to make sure you are passing the reference to a new array not the same
one.
When I change the array for item1 it also affects item2
I have a 2 classes:
class A
{
float[] mArray;
public float[] mArray
{
get { return this.mArray;}
set { this.mArray = value;}
}
}
class B
{
List<A> myA = new List<A>();
public B()
{
myA.Add(new A());
myA.Add(new A()); // I expect to now have two objects, each
with an array mArray.
}
//need help here also - how to get based on index in list
public float[] mArray0
{
get { return myA[0].mArray}
}
public float[] mArray1
{
get { return myA[1].mArray}
}
}