title: Passing an array of arbitrary struct pointers to a C function?
body: <p>I want to pass an array of arbitrary struct pointers and a comparison function to a generic sorting algorithm. Is this possible in C?</p>
  
  <p>The goooeys of the structs would only be accessed within the comparison function, the sorting function would only need to call the comparison function and swap pointers, but I can't figure out how to declare it.</p>
  
  <pre><code>function sorter( struct arbitrary ** Array, int Length, int cmp(struct node * a, struct node * b))
  {
      for (int i=0; i&lt;Length;i++){
          if cmp(Array[i],Array[i+1]){
              swap(Array[i],Array[i+1]
         }
      }
  }
  </code></pre>