dave_p_r_b
asked on
Passing class derived from ArrayList
my class "List", is derived from "ArrayList".
I have a function, "foo" that accepts an "ArrayList" as a parameter.
foo(ref ArrayList al)
{
...
}
I want to pass an object of type "List" to foo:
foo(ref List )
but when i cast it, it says it needs to be an lvalue, because its a ref.
What should i be doing?
TIA.
I have a function, "foo" that accepts an "ArrayList" as a parameter.
foo(ref ArrayList al)
{
...
}
I want to pass an object of type "List" to foo:
foo(ref List )
but when i cast it, it says it needs to be an lvalue, because its a ref.
What should i be doing?
TIA.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for your help!
For anyone else, I found an article on msdn that explains "Passing Reference types by value" .
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vclrfPassingMethodParameters.asp