title: qsort() and casting operation
body: <p>Consider an array of <strong>pointers to structs</strong>. The following code is taken from an example you may find <a href="http://c-faq.com/lib/qsort2.html" rel="nofollow">here</a>. I'd like to get an explantation for those two rows of casting. I'm not familiar with this "double casting".</p>
  
  <pre><code>int myptrstructcmp(const void *p1, const void *p2)
  {
      struct mystruct *sp1 = *(struct mystruct * const *)p1;
      struct mystruct *sp2 = *(struct mystruct * const *)p2;
  </code></pre>
  
  <p>I thought it should be:</p>
  
  <pre><code>int myptrstructcmp(const void *p1, const void *p2)
  {
      struct mystruct *sp1 = (struct mystruct *)p1;
      struct mystruct *sp2 = (struct mystruct *)p2;
  </code></pre>