So I am new to C# and I am having difficulty understanding out
. As opposed to just returning something from a function
using System;
class Retur
When one variable is concerned out and return are OK. But what if you wanted to return more than 1 values? Out
helps in that.
static void CalculateArea(out double r, out double Foo)
{
//Can return 2 values in terms of out variables.
}
static double CalculateArea(double r)
{
// Will return only one value.
}