title: Passing pointer argument by reference under C?
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  void
  getstr(char *&amp;retstr)
  {
   char *tmp = (char *)malloc(25);
   strcpy(tmp, "hello,world");
   retstr = tmp;
  }
  
  int
  main(void)
  {
   char *retstr;
  
   getstr(retstr);
   printf("%s\n", retstr);
  
   return 0;
  }
  </code></pre>
  
  <p><code>gcc</code> would not compile this file, but after adding <code>#include &lt;cstring&gt;</code> I could use g++ to compile this source file.</p>
  
  <p>The problem is: does the C programming language support passing pointer argument by reference? If not, why?</p>
  
  <p>Thanks.</p>