C# -Daily Learning

Friday, June 4, 2010

Difference between ref and out parameter

a ref parameter should be assigned before they are called.
out are assigned by the called function itself.
out parameter is used to return more than one values from a function other than return object.
ref = Reference, when parsed to a method, the method references that original variable and doesnt create another instance. So if you make a change to a var parsed into that method when ref is used, it will affect the calling method

Labels: ,

0 comments: