PointPairList one = new PointPairList(); one.Add(0, 0); one.Add(0, 0); one.Add(0, 0); one.Add(0, 0); one.Add(0, 0); List<PointPairList> two = new List<PointPairList>(); for (i=1;i<n;i++) { listBox1.Items.Add(i+" "+az[i]+" "+bz[i]+""); if ((i % 3) == 0) { one[0]=new PointPair(az[i], 2); one[1] = new PointPair(az[i], -2); one[2] = new PointPair(bz[i], 2); one[3] = new PointPair(bz[i], -2); one[4] = new PointPair(az[i], 2); two.Add(one); } }
In two [0], one is added at the first step, then in two [1], one is added at the second step, but at the same time, in two [0], the one element is changed and has the value one at the second step. How do I make it so that the values in two do not change with each step?