/** * Frees all of the memory that is allocated for the htable. * * @param h the htable to be freed. */ void htable_delete(htable h){ int i; free(h->count); for (i = 0; i < h->capacity; i++) { if (h->keys[i].key != NULL) { free(h->keys[i].key); flexarray_delete(h->keys[i].postings); } } free(h->keys); free(h); }
int main(void) { int item; flexarray f1 = flexarray_new(); while(1 == scanf("%d",&item)) { flexarray_append(f1,item); } flexarray_sort(f1); flexarray_print(f1); flexarray_delete(f1); return EXIT_SUCCESS; }