title: How to cast double to float pointer?
body: <p>I'm trying to cast double to float pointer but I don't know the proper way to do it.</p>
  
  <p>Here's my code</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  int main(int argc, const char * argv[]) {
      // insert code here...
  
  
      float *f;
      double d = 10;
  
      f = reinterpret_cast&lt;float*&gt;(&amp;d);
      d = 20;
  
      std::cout &lt;&lt; "RESULT : " &lt;&lt; *f &lt;&lt; std::endl;
      return 0;
  }
  </code></pre>
  
  <p>And I get the following result.</p>
  
  <pre><code>RESULT : 0
  Program ended with exit code: 0
  </code></pre>
  
  <p>How do I properly cast double to float pointer?</p>
  
  <p><strong>ADD : The result I expect to get is 20</strong></p>