title: string swapping works well with char ** but not with char *
body: <p>In this program I have swapped the first 2 names</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  void swap(char **,char **);
  main()
  {
   char *name[4]={"amol", "robin", "shanu" };
   swap(&amp;name[0],&amp;name[2]);
   printf("%s %s",name[0],name[2]);
  }
  void swap(char **x,char **y)
   {
   char *temp;
   temp=*x;
   *x=*y;
   *y=temp;
   }
  </code></pre>
  
  <p>This programs runs perfectly but when I use the <code>function swap(char *,char *)</code> it does not swap the address why? why I have to use pointer to pointer?</p>