CSharp examples for Language Basics:ref
Ref Local Arrays
using System.ComponentModel; class RefLocalArrays { static void Main() {/*from w ww . j ava 2 s . c o m*/ var array = new (int x, int y)[10]; for (int i = 0; i < array.Length; i++) { array[i] = (i, i); } for (int i = 0; i < array.Length; i++) { ref var element = ref array[i]; element.x++; element.y *= 2; } } }