Not sure what your problem is, but a few pointers:
1. what is wrong with
qsort()
from stdlib.h?
2. you are using
strcpy
to copy the items, it would be much more preferable to just copy the pointes to the strings (this may also be the source of any problems) since you will be over-running some string buffers:
char str[][10] = { "this","is","a","test","ustafa","x","q","mu","a","f","u","t","d","g","g","c"};
For the string "a" for example, 2 bytes is allocated on the stack for it {'a', '\0'}, if you then copy "this" into that location, you will overrun the buffer (copying 5 bytes), most likely into the next string, "test".
This is most likely the cause if what you are getting is a big jumble of random characters