1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#ifndef ARRAY_H #define ARRAY_H #include <stdlib.h> #define DEFAULT_ARR_LEN 10 typedef struct { void **items; size_t size; size_t capacity; } array_t; array_t *init_array(); void array_push(array_t *a, void *item); void *array_pop(array_t *a); void array_free(void *a, void (*freefunc)(void *)); #endif