CSharp examples for Language Basics:ref
Ref Return No Local Variable
using System;/* w ww. j ava 2 s .c om*/ class RefReturnAsRefArgument { static void Main() { int x = 10; RefReturn(ref RefReturn(ref RefReturn(ref x)))++; Console.WriteLine(x); } static ref int RefReturn(ref int p) { return ref p; } }