Passing array elements by reference

  • Thread starter Thread starter Dominic
  • Start date Start date
D

Dominic

If I have a method

private void Set(ref uint x)
{
x = 3;
}

how do I use this with an array element?

uint[] a = new uint[10];
Set(a[1]);

complains that it cannot convert argument 1 from uint to ref uint.

TIA

Dom
 
Back
Top