Getting wrong sort with qsort – C

I’m trying to sort an array of pointers to structures using the the qsort function, here’s the code: #include <stdio.h> #include <string.h> #include <stdlib.h> struct hotel { char *address; _Bool full; int nrooms; }; /* compare based on the value of nrooms */ int roomcomp(const void *p1, const void *p2) { return ( ((struct hotel… Read More Getting wrong sort with qsort – C