title: qsort() not working for array of number
body: <p>Actually i have to create huffman tree for that i need to sort the frequency and i am using qsort() function for that.
  But when i try to display the frequency it show still the same pattern (Not the sorted one).
  Here is my code:-</p>
  
  <pre><code>        struct node
          {
              int value;
              char letter;                 /* symbol */
              struct node *left,*right;    /* left and right subtrees */
          };
      typedef struct node Node;
  //Given below is the frequency of all 27 alphabets
  int englishLetterFrequencies [27] = {81, 15, 28, 43, 128, 23, 20, 61, 71, 2, 1, 40, 24, 69, 76, 20, 1, 61, 64, 91, 28, 10, 24, 1, 20, 1, 130};
  </code></pre>
  
  <p>here is my function where i try to build huffman (its inside the main() ):</p>
  
  <pre><code>/*builds the huffman tree and returns its address by reference*/
  
      void buildHuffmanTree(Node **tree){
          Node *temp;
          Node *array[27];
          int i, subTrees = 27;
          int smallOne;
  
          for (i=0;i&lt;27;i++)
          {
              array[i] = malloc(sizeof(Node));
              array[i]-&gt;value = englishLetterFrequencies[i];
              array[i]-&gt;letter = i;
              array[i]-&gt;left = NULL;
              array[i]-&gt;right = NULL;
          }
           smallOne=sorting(array); //this function is responsible for sorting. I HAVE QSORT() CALL IN THIS FUNCTION
  
      return;
  }
  </code></pre>
  
  <p>see its function definition :</p>
  
  <pre><code>int sorting(Node *array[])
  {
      int smaller;
      int i = 0; int d,p;
      printf("the array frequency is \n");
      for(d=0;d &lt; 27;d++)
      printf("%d  ",*array[d]);
      // sorting of arrays
      qsort(array,27,sizeof(*array),&amp;cmpfunc); 
      //////////////////////////
      printf("\n the sorted array frequency is \n");
          for(p=0;p &lt; 27;p++)
      printf("%d  ",*array[p]);
  
      return smaller;
  }
  </code></pre>
  
  <p>whereas the cmpfunc() is here like this //PROBABLY MISTAKE IS HERE</p>
  
  <pre><code> int cmpfunc (const void * a, const void * b)
      {
            return ( ((Node *)a)-&gt;value - ((Node *)b)-&gt;value );
      }
  </code></pre>
  
  <p>Any idea why it don't sort the arrays ?</p>