I've just started using generic List<t>'s and have come across some problems.
Before with an array of structs i could directly modify it's members e.g.:
But when i try with a List<T> i get Compiler Error CS1612 "Cannot modify the return value of 'expression' because it is not a variable"
And secondly if i try to pass an element of a generic list as a ref parameter i get Compiler Error CS0206 "A property or indexer may not be passed as an out or ref parameter"
Thanks for any help.
Before with an array of structs i could directly modify it's members e.g.:
Code:
Public struct test
{
string str;
int i;
}
Public void main()
{
test[] aArray = new test[5];
aArray.str = "Hello World";
}
And secondly if i try to pass an element of a generic list as a ref parameter i get Compiler Error CS0206 "A property or indexer may not be passed as an out or ref parameter"
Thanks for any help.