title: converting .net reference to c++ reference
body: <p>I have a c++ function called <code>innergetnum</code> that gets as a parameter <code>float&amp; num</code></p>
  
  <p>I write in managed c++ a function with the following code:</p>
  
  <pre><code>void getnum(float% num)
  {
      innercppclass.innergetnum(num);
  }
  </code></pre>
  
  <p>It doesn't work because he fails to convert <code>num</code> to <code>float&amp;</code></p>
  
  <p>The only solution I found is to make additional temp variable <code>float tmp</code>, pass it to <code>innergetnum</code> and then to assign it to <code>num</code>.</p>
  
  <p>Unfortunately I have many ref variables I want pass and the code looks ugly and I feel like the temp variable is a hack.</p>
  
  <p>Is there a better way to solve it?</p>