CSharp examples for Custom Type:Method Parameter
Mark Reference parameter variables
using System;/* w ww . j av a 2 s . c o m*/ class nbr { public double square( ref double x ) { x = x * x; return x; } } class TestApp { public static void Main() { nbr doit = new nbr(); double nbr1 = 3; double retVal = 0; Console.WriteLine("Before square -> nbr1 = {0}, retVal = {1}", nbr1, retVal); retVal = doit.square( ref nbr1 ); Console.WriteLine("After square -> nbr1 = {0}, retVal = {1}", nbr1, retVal); } }