CSharp examples for Language Basics:ref
Ref Return from a method
using System;/*from ww w.ja v a 2 s .co m*/ using System.ComponentModel; using System.Threading.Tasks; class RefReturnSimple { static void Main() { int x = 10; ref int y = ref RefReturn(ref x); y++; Console.WriteLine(x); } static ref int RefReturn(ref int p) { return ref p; } }