use trie data structure to solve the problem of clustering anagrams
#include &lt;cstring&gt;


Avoid including C headers when programming C++.

struct Index_node_base
{
    Index_node_base* next;
    Index_node_base():next(NULL){}  
};

struct Index_node : public Index_node_base
{
    int index;
    Index_node(int i):index(i), Index_node_base(){}
};

void insert_index_node(Index_node** head, int i)
{
     Index_node* node = new Index_node(i);
     node-&gt;next = (*head);
     *head = node;
}


This is overkill as you are just re-implementing a list of numbers / characters.

const char*


This is C code, consider using the C++ std::string instead.

const char* word_arr[]


For example, this one should be a std::list&lt;std::string&gt; (a.k.a. list&lt;string&gt;)

 printf("%s\n", word_arr[h-&gt;index]);


Again C, use the C++ iostreams instead. This should be like cout &lt;&lt; ... &lt;&lt; endl;

while(*w)
{
    int i = *w - 'a';
    if(r-&gt;child[i] == NULL)
    {
        r-&gt;child[i] = new Trie_node(r-&gt;num_of_child);
    }
    r = (Trie_node*)r-&gt;child[i];
    ++w;
}


You can use iterators and STL algorithms to do this in one line.

for(i = 0; i &lt; r-&gt;num_of_child; ++i)
{
    if(r-&gt;child[i] != NULL)
        traversal_trie(word_arr, (Trie_node*)r-&gt;child[i]);
}


This would also be one line using for_each on iterators and passing traversal_trie.

void Trie::destroy(Trie_node* root)


You won't need destory anymore as a result; also, there's a chance you might not need pointers.

static int comp_char(const void* x, const void* y)
{
    const char* c1 = (const char*)x;
    const char* c2 = (const char*)y;

    return *(c1) - *(c2);
}


This is messsy, you are doing useless C style voids and casts and not using C++ overloading. This body would have been something along the line of just the line return c1 &lt; c2;

for(i = 0; i &lt; size; ++i)
{
    int len = strlen(word_arr[i]);
    buffer = new char [len+1];
    memcpy(buffer, word_arr[i], len+1);        
    qsort(buffer, strlen(buffer), 1, comp_char);   
    trie-&gt;insert_trie_node(buffer, i);          
    delete buffer;
}


memcpy? Not necessary, std::string allows you to copy the string and not mess with memory.