title: Is it Possible to Return a Reference to a Variable in C#?
body: <p>Can I return a reference to a double value for example?</p>
  
  <p>This is what I want to do:</p>
  
  <pre><code>ref double GetElement()
  {
     ......
     // Calculate x,y,z
     return ref doubleArray[x,y,z];
  }
  </code></pre>
  
  <p>To use it like this</p>
  
  <pre><code>void func()
  {
     GetElement()=5.0;
  }
  </code></pre>
  
  <p>It is like returning a double pointer in C++ ...
  I know that the way I wrote it is wrong.. but is there a correct way for doing it?</p>