In c# , when sending a parameter to a method, when should we use "ref" and when "out" and when without any of them?
['https://Stackoverflow.com/questions/1115762', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/61156/']
In addition to Colin's detailed answer, you could also use out parameters to return multiple values from one method call. See for example the method below which returns 3 values.

```
static void AssignSomeValues(out int first, out bool second, out string third)
    {
        first = 12 + 12;
        second = false;
        third = "Output parameters are okay";
    }

```

You could use it like so

```
static void Main(string[] args) {
        int i;
        string s;
        bool b;

        AssignSomeValues(out i, out b, out s);

        Console.WriteLine("Int value: {0}", i);
        Console.WriteLine("Bool value: {0}", b);
        Console.WriteLine("String value: {0}", s);

        //wait for enter key to terminate program
        Console.ReadLine(); }

```

Just make sure that you assign a valid value to each out parameter to avoid getting an error.
ref is to be avoided (I beleive there is an fx-cop rule for this also) however use ref when the object that is reference may itself changed. If you see the 'ref' keyword you know that the underlying object may no longer be referenced by the same variable after the method is called.