I want to sort an array of pointers by Id\'s. However qsort fails to work because of my lack of experience with pointers.
typedef struct block{ int Id; c
You have an array of pointers to block, not an array of int. The sizeof argument is the size of the elements in the array, not the size of the data you want to compare.
block
int
sizeof
So the correct call would be e.g.
qsort(database->data, database->size_array, sizeof *database->data, compare);