title: in c, if i have char *const* pointer, how do i access each and every element?
body: <p>this is for the qsort comparison function, </p>
  
  <pre><code>int cmp(const void *p, const void *q) {
      char *const* pp = p;
      char *const* qq = q;
      ...
  }
  </code></pre>
  
  <p>i want to compare the elements of the two strings. i tried (*pp)[i] since *pp is p, but it doesnt seem to work. also, what is the advantage of catching p and q this way instead of just creating two const char *?</p>
  
  <p>last but no least, i have another comparison function that is supposed to skip leading white spaces</p>
  
  <pre><code>int wcmp(const void *p, const void *q) {
  
      const char *pp = p;
      const char *qq = q;
      size_t i = 0;
      size_t j = 0;
  
      while(isspace(*(pp+i))) {
          i++;
      }
  
      while(isspace(*(qq)+j)) {
          j++;
      }
  
      return strcmp(pp+i, qq+j);
  }
  </code></pre>
  
  <p>but when i test it with </p>
  
  <pre><code>    d afdsa
     hello
    heal
  </code></pre>
  
  <p>the output is</p>
  
  <pre><code>  heal
      d afdsa
     hello
  </code></pre>
  
  <p>what is going on with "d afdsa" in the middle?</p>