title: When convert a void pointer to a specific type pointer, which casting symbol is better, static_cast or reinterpret_cast?
body: <p>In this program I have a <code>void *</code> as a parameter and want to cast it to a specific type. But I don't know which &quot;casting symbol&quot; to use.  Both <code>static_cast</code> or <code>reinterpret_cast</code> work.  Which one is better? Which one does the Standard C++ recommend?</p>
  <pre><code>typedef struct
  {
      int a;
  }A, *PA;
  
  int foo(void* a)                // the real type of a is A*
  {
      A* pA = static_cast&lt;A*&gt;(a); // or A* pA = reinterpret_cast&lt;A*&gt;(a);?
      return pA-&gt;a;
  }
  </code></pre>
  <p>Here, is</p>
  <pre><code>A* pA = static_cast&lt;A*&gt;(a);
  </code></pre>
  <p>or</p>
  <pre><code>A* pA = reinterpret_cast&lt;A*&gt;(a);
  </code></pre>
  <p>more proper?</p>