Indicator for void
The announcement qsort(s) is as follows:
void qsort (void* base, size_t num, size_t size, int (*compar)(const void*,const void*));
How does work with the base indicator work within this function? The normal index can be moved:
a += 5// a += 5 * sizeof(*a);
How can this be done, knowing the size of the elements (size)?
In fact, the void itself is not moving, and it leads to a type that can be moved to the indicator on the char.
That's why your code's so up.
char *pa = (char*)a; // вначале сделаем приведение a = a + 5 * sizeof(элемент); // а теперь можно свободно двигать
In fact, everything can be seen and studied on its own. Like here. https://android.googlesource.com/platform/bionic.git/+/eclair-release/libc/stdlib/qsort.c