i have an array which contains third level pointers :

char * arrP1 [ ] = { "father", "mother", NULL},
	                     * arrP2 [ ] = { "sister", "brother", "grandfather", NULL }, 
                       * arrP3 [ ] = { "grandmother", NULL},
                       * arrP4 [ ] = { "uncle", "aunt", NULL };
	               char ** arrPP [ ] = { arrP1, arrP2, arrP3, arrP4 , NULL};

what is the best way to sort all strings in arrPP in lexicographical order
so i can print them all in this order.

if it helps i can sort each *arr[] seperatly

10 Years
Discussion Span
Last Post by Duoas

>>what is the best way to sort all strings in arrPP
Declare them all in one big array and in sorted order then you won't have to worry about that.


Did you just give up or did AD's suggestion help solve your problem?

I've had occasion to arrange an array of pointers to string just like you are, which is fine, but without a better idea of what you are trying to do with all the indirection it is hard to help you.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.