title: Question relate to pass by reference in C
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  char *addXX(char *B);
  
  int main(void) {
    char str1[25], *str2;
    gets(str1);
    str2=addXX(str1);
    puts(str2);
    exit(0);
  }
  char *addXX(char *B) {
    strcat(B,"XX");
    return (B);
  }
  </code></pre>
  
  <p>This is the note I got from my class, which shows how call by reference works in C. However, there is one thing I don't understand. In the <code>*addXX</code> function, we passed <code>str1</code> into the function, which is also the memory address since it's an array name. Then we store the <code>str1</code> memory address into pointer <code>char*B</code>, but we don't add <code>*</code> in front B when we use <code>B</code> in the function.  This is the part I don't understand, why we should not use <code>*B</code> instead <code>B</code>? </p>
  
  <p>Can anyone explain it to me? </p>