title: Sorting list array of strings in C
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  void ascending_sort(char *name, char **pName, unsigned int size);
  
  int main(){
     char * names[] = {&quot;Ellin&quot;,&quot;Alexa&quot;,&quot;Eliza&quot;,&quot;Celiza&quot;, NULL};
  ascending_sort(names[0],names,( sizeof(names)/sizeof(char *)) - 1);
  return 0;
  }
  
  void ascending_sort(char *name, char **pName, unsigned int size){
      unsigned int i;
      unsigned int z;
      int keep;
      char temp;
      /// print out the array
      for (i = 0; i &lt; size; i++)
      {
          printf(&quot;str: %s\n&quot;, pName[i]);
      }
  
      ///start sorting...
      for (i = 0; i &lt; size; i++){
          keep = i;
          for(z = i; z &lt; size; z++){
              if(pName[keep]&gt;pName[z]){
                 keep = z;
              }
          }
          temp = pName[i];
          pName[i] = pName[keep];
          pName[keep] = temp;
  
      }
      for (i = 0; i &lt; size; i++){
          printf(&quot;str: %s\n&quot;, pName[i]);
      }
  }
  </code></pre>
  <p>I'm confused with double pointer(char**).
  How can I print out each element of array in function with 'for' loop (so I can easily understand) and sorting it (using 'for' loop)?</p>
  <h1>help fix my sorting algorithm, it didnt work</h1>