C# language feature:
applies to
benefit
- Allows passing and return of references from methods. Can be used to improve performance when working with large data structures.
how to use
- Prefix parameter and or return value type with
ref
modifier.
note
ref
must be mutable fields or passed by reference, also ref
can be used to reference arrays elements.
example: