title: Changing address contained by pointer using function
body: <p>If I've declared a pointer <code>p</code> as <code>int *p</code>; in main module, I can change the address contained by <code>p</code> by assigning <code>p = &amp;a;</code> where <code>a</code> is another integer variable already declared.
  I now want to change the address by using a function as:</p>
  <pre><code>void change_adrs(int*q)
  {
      int *newad;
      q = newad;
  }
  </code></pre>
  <p>If I call this function from main module</p>
  <pre><code>int main()
  {
      int *p;
      int a = 0;
      p = &amp;a; // this changes the address contained by pointer p
      printf(&quot;The address is %u\n&quot;, p);
      change_adrs(p);
      printf(&quot;The address is %u\n&quot;, p); // but this doesn't change the address
      return 0;
  }
  </code></pre>
  <p>the address content is unchanged. What's wrong with using a function for same task?</p>