title: C vs. C++, handling of void** pointers
body: <p>I found out that using a C compiler the code below works but not with a C++ compiler. I understand that casting to <code>void**</code> is the correct usage but I can't understand why it compiles with the C compiler even if I use the <code>void*</code> (commented out).</p>
  
  <pre class="lang-c prettyprint-override"><code>#include &lt;stdio.h&gt;
  
  int fn(void **arg)
  {
      int *pvalue = *(int**)arg;
      *pvalue = 200;
      return 0;
  }
  
  int main()
  {
      int value = 99;
      int *pvalue = &amp;value;
  
      // fn((void *)&amp;pvalue);  // works only in C
      // error C2664: 'int fn(void **)': cannot convert argument 1 from 'void *' to 'void **'
  
      fn((void **)&amp;pvalue);    // correct, works for both C/C++
  
      printf("%d", value);
      return 0;
  }
  
  </code></pre>
  
  <p>Can someone explain why this is the case?</p>