In C#, parameters can be passed either by value or by reference. Passing parameters by reference enables function members, methods, properties, indexers, operators, and constructors to change the value of the parameters and have that change persist. To pass a parameter by reference, use the ref or out keyword. For simplicity, only the ref keyword is used in the examples in this topic. For more information about the difference between ref and out, see ref (C# Reference), out (C# Reference), and Passing Arrays Using ref and out (C# Programming Guide). For example:
C# Copy Code
// Passing by value
static void Square(int x)
{
// code...
}
C# Copy Code
// Passing by reference
static void Square(ref int x)
{
// code...
}
This topic includes the following sections:
http:msdn.microsoft.com/en-us/library/9t0za53s.aspx
http:msdn.microsoft.com/en-us/library/s6938f28.aspx
Also see the follwoing article
http://en.csharp-online.net/Common_Type_System%E2%80%94Pass-by-Value_and_Pass-by-Reference
Hope it helps.