>>15
notacija temp = new notacija(0, 1, 2);
Notacija.Add(temp);
Notacija.Add(temp);
Notacija[0].pot.Add(1);
Notacija[1].pot.Add(2);
int stevec = 0;
string ss = "";
for (int b = 0; b < Notacija.Count; b++)
{
ss = "";
for (int a = 0; a < Notacija[b].pot.Count; a++)
{
ss += Notacija[b].pot[a] + " ";
}
MessageBox.Show(stevec + " " + ss);
}
You can paste the class and use this if you want to see the problem if not let me explain:
Notacija is a list of notacija, so i add 2 object to it. Then i add to the List pot in the first object the number 0 and in the second object the number 2.
When i write out the List pot of every object it is like i added both numbers to both lists