Hi Arne,
It depends whether the returned object is of value type or reference type.
All types decalred using the keyword *class* are reference types as such all
object returned as from methods or used as parameters are just references.
All types that inherit from ValueType class are value types and the object
itself is copied when instance of such type is. Value types are all types
declared using *struct* or *enum* keywords, which means that in your sample
getItemFile method will return a reference to the object rather than the
object istelf.
I'd suggest consulting the docs for the difference between value and
reference types as well as reading about boxing/unboxing value types.
--
HTH
Stoitcho Goutsev (100) [C# MVP]
If you look in MSDN you'll see that ArrayList is decalred as a *class*
"Arne" <Ar**@discussions.microsoft.com> wrote in message
news:20**********************************@microsof t.com...
How do I return a references to an object from a function?
static ArrayList getItemFile(string destdir){...}
Does the above code return the whole Arraylist on the stack or does it
return a reference?