title: double pointer vs single pointer
body: <p>Can someone explain / give a reasoning to me on why the value of variable i in main function in below code snippet does not change via function test1 while it does change via test2? I think a single pointer should be sufficient to change the value of i. Why are we supposed to use double pointer?  </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void test1(int* pp)
  {
     int myVar = 9999;
     pp = &amp;myVar;
  }
  
  void test2(int** pp)
  {
     int myVar = 9999;
     *pp = &amp;myVar;
  }
  
  int main()
  {
     printf("Hej\n");
     int i=1234;
     int* p1;
  
     p1 = &amp;i;
  
     test1(p1);
     printf("does not change..., p1=%d\n",*p1);
  
     test2(&amp;p1);
     printf("changes..., p1=%d\n",*p1);
     return 0;
  }
  </code></pre>