Link to home
Start Free TrialLog in
Avatar of dave_p_r_b
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.
ASKER CERTIFIED SOLUTION
Avatar of gav_jackson
gav_jackson

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dave_p_r_b
dave_p_r_b

ASKER

No, youve hit the point spot on.

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