Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

c# List<int> in class

Name: tt 2011-03-05 12:18

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: >>21 2011-03-05 12:40

Example:
notacija X = new notacija(1, 2, 3);
notacija Y;

X = Y;

X.f = 2;
Y.f = 3;

At this point, X.f and Y.f contain different values as they are fields of two different structs. However, X.pot and Y.pot point to the exact same reference, that is, the one created in the construct at X's initialization.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List