title: Pointers as function arguments in C
body: <p>If I were to have this code, for example:</p>
  
  <pre><code>int num = 5;
  int *ptr = &amp;num;
  </code></pre>
  
  <p>What is the difference between the following two functions?</p>
  
  <pre><code>void func(int **foo);
  void func(int *foo); 
  </code></pre>
  
  <p>Where I call the function:</p>
  
  <pre><code>func(&amp;ptr); 
  </code></pre>
  
  <hr>
  
  <p>I realize that the former of the two takes a pointer to a pointer as a parameter, while the second takes only a pointer.</p>
  
  <p>If I pass in <code>func(&amp;ptr)</code>, I am effectively passing in a pointer. What difference does it make that the pointer points to another pointer? </p>
  
  <p>I believe the latter will give an incompatibility warning, but it seems that the details do not matter so long as you know what you are doing. It seems that perhaps for the sake of readability and understanding the former is a better option (2-star pointer), but from a logical standpoint, what is the difference? </p>