title: C++: can't static_cast from double* to int*
body: <p>When I try to use a static_cast to cast a double* to an int*, I get the following error:</p>
  
  <pre><code>invalid static_cast from type ‘double*’ to type ‘int*’
  </code></pre>
  
  <p>Here is the code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  int main()
  {
          double* p = new double(2);
          int* r;
  
          r=static_cast&lt;int*&gt;(p);
  
          std::cout &lt;&lt; *r &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>I understand that there would be problems converting between a double and an int, but why is there a problem converting between a double* and an int*?</p>