Thank you! It works. But I still don't understand why is this. Each element in array A is char*, isn't it? Originally Posted by Salem Your cast inside the compare function is wrong. *(char**)str1