title: Correctly pass a char array and char pointer to function by reference in C
body: <p>Is there a right way to call a char array and a char pointer to go to a function but it's pass by reference where it will also be manipulated? </p>
  
  <p>Something like this:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  void manipulateStrings(char *string1, char *string2[])
  {
  
      strcpy (string1, "Apple");
      strcpy (string2, "Banana");
  
      printf ("2 string1: %s", string1);
      printf ("2 string2: %s", &amp;string2);
  
  }
  
  
  int main ()
  {
      char *stringA;
      char stringB[1024];
  
      stringA = (char *) malloc ( 1024 + 1 );
  
      strcpy (stringA, "Alpha");
      strcpy (stringB, "Bravo");
      printf ("1 stringA: %s", stringA);
      printf ("1 stringB: %s", stringB);
  
      manipulateStrings(stringA, stringB);
  
      printf ("3 stringA: %s", stringA);
      printf ("3 stringB: %s", stringB);
  
  
      return 0;
  }
  </code></pre>
  
  <p>I am not sure if I'm understanding correctly how to pass such variables to a function and change the values of those variables who happen to be char / strings</p>
  
  <p>Edit: My question is - How would you be able to change the values of the two strings in the function?</p>