C#: 12-out & ref Keywords
out : Updating a Value type from called function
public static void ValueTypes()
{
var x = 2;
Console.WriteLine("ValueTypes: var x=2");
Console.WriteLine("ValueTypes: Five(x): Before: {0}", x);
// passes the VALUE to func so WILL NOT CHANGE ITS VALUE
Console.WriteLine("ValueTypes: Five(x):calling..");
Five(x);
Console.WriteLine("ValueTypes: Five(x): AFTER: {0}", x);
}
static void Five(int a)
{
a = 5;
Console.WriteLine("ValueTypes: IN..Fix(int a): assigning a=5");
}
