[ dontoo @ 03.04.2010. 10:06 ] @
Recimo imam:
StructMy a = new StructMy(); //public int x, int y članovi
List<StructMy> b = new List<StructMy>();
a.x = 3;
a.y = 4;
b.Add( a );
b[0].x = 5 //Nemože, b[0].x nije varijabla, moram napravit novi objekt struckture i zamijenit ga sa starim

Totalna glupost.
[ lonelyrider_44 @ 03.04.2010. 10:51 ] @
Bash i nije glupost, ako se uzme u obzir smisao strukture(struct). Koristi
klasu umesto strukture i radice.


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
[ Igor Gajic @ 03.04.2010. 10:53 ] @
Citat:

The operator [] is actually a function call. When you index a list and get the individual element, you are actually making a function call. You get the individual element as the return value of the function. This return value is placed on the stack and when you try to use the dot operator on this, you are actually trying to modify the return value of the function. i.e. you are modifying a copy of the element and your modifications will not affect the element in the list. The compiler, smart it is, catches this and informs you of the pitfall.


Mislim da ovo daje odgovor na "glupost". Manje vise svi pre ili kasnije nalete na taj problem...

http://generally.wordpress.com/2007/06/21/c-list-of-struct/
[ dontoo @ 03.04.2010. 12:40 ] @
kad sam u C-u navikao koristiti strukture pa ih koristim i u objektnim jezicima
[ deerbeer @ 03.04.2010. 13:29 ] @
Pa navikni se , nece boleti glava od klasa :)