So i made a class and put a public List<int> in there. Seems like every element in that class is using the same list. Even though i have new list() in the constructor.
Can anybody help?
Name:
Anonymous2011-03-05 12:22
public struct notacija : IComparable<notacija>
{
public int f;
public int g;
public int h;
public List<int> pot;
public int CompareTo(notacija other)
{
return f.CompareTo(other.f);
}
public notacija(int b, int c, int d)
{
f = b + c;
g = b;
h = c;
pot=new List<int>();
pot.Add(d);
}
public notacija(int b, int c)
{
f = b + c;
g = b;
h = c;
pot = new List<int>();
}