C# Ref returns and locals
C# ref keyword allows a method to return reference rather than a value. In C# prior versions, a method can return only value.
A variable that holds returned reference known as ref local.
A method that returns reference has certain restrictions that are listed below.
Let's see an example.
C# Ref Returns Example
Ref local is a variable that is used to store the reference returned by the method. Let's see an example.
C# Ref Local Example
Array: [Rahul,John,Mayank,Irfan] Updated array: [Rahul,John,Mayank,Peter]