Ref Local Identity Conversions - CSharp Language Basics

CSharp examples for Language Basics:ref

Description

Ref Local Identity Conversions

Demo Code

using System;// www.j a v a2s  .  c om
using System.ComponentModel;
class MainClass
{
   static void Main()
   {
      (int x, int y) tuple1 = (10, 20);
      ref (int a, int b) tuple2 = ref tuple1;
      tuple2.a = 30;
      Console.WriteLine(tuple1.x);
   }
}

Result


Related Tutorials