References to variables in C#?
<p>In C++, I can do something like this:</p>

<pre><code>int i[10] = 
int *p = &amp;i[5];
</code></pre>

<p>Then, I can always know that p points to the 5th element of int array i, regardless of i's contents.</p>

<p>Is there any way to do something similar in C#?  </p>

<p>I realize this is likely one of the ways in which C# "protects" us from ourselves, so i'm not looking for an exact equivelent, but rather a similar concept... that is, being able to refer to the contents of some other variable, rather than the instance of the variable itself.</p>

<p>Here's my use case i'm thinking  of.  I have an array of strings.  I would like to have another array of references to those array elements.  Something like this (obviously not valid code):</p>

<pre><code>string[] s = new string[] { "one", "two", "three", "four", "five", "six" };
stringref[] sr = new stringref[] { &amp;s[0], &amp;s[1], &amp;s[2], &amp;s[3], &amp;s[4], &amp;s[5] };

Console.WriteLine(sr[1]); // == "two"
s[1] = "two point zero";
Console.WriteLine(sr[1]); // == "two point zero"
</code></pre>

<p>Certainly, ref paramets do this, and out parameters allow you to write to a specific variable.  But what about non-parameters?  Can you store a ref?  Can you keep an array of refs or a dictionary?</p>

<p>It seems like if the ability to do it with parameters is present, there should be a way to do it without them.</p>
