ref- use to pass by reference in function argument
out-similar to ref but pass out value from the function..below example
class Test
{
void refDemo(ref int i)
{
i= i*10;
}
int FindDecimal(float f,out float dp)
{
int i=(int) f;
dp=f-i;
return i;
}
}
class RefExample
{
public statc void Main(string []args)
{
Test obj=new Test();
int i=10;
Console.WriteLine("Before Call i:" + i);
obj.refDemo(ref i);
Console.WriteLine("After Call i:" + i);
obj.FindDecimal(12.2345f,out float f);
Console.WriteLine("Decimal points f:" + f);
}
}