CSharp examples for Custom Type:Method Parameter
Swap two parameter using ref
using System;/*from ww w. java 2s. c o m*/ class Swapper { public static void Main() { int myValue = 10; int yourValue = 20; Swap(ref myValue, ref yourValue); Console.WriteLine("My value: {0} Your value: {1}", myValue, yourValue); } public static void Swap(ref int a, ref int b) { int temp; temp = a; a = b; b = temp; } }