diff options
Diffstat (limited to 'dynamic_array.h')
-rw-r--r-- | dynamic_array.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/dynamic_array.h b/dynamic_array.h new file mode 100644 index 0000000..98491ea --- /dev/null +++ b/dynamic_array.h @@ -0,0 +1,20 @@ +#ifndef DYNAMIC_ARRAY_H_SENTRY +#define DYNAMIC_ARRAY_H_SENTRY + +enum { + initial_size = 10 +}; + +struct dynamic_array { + char *arr; + int last_element_index; + int allocation_size; +}; + +void dynarr_create_array(struct dynamic_array *array); +void dynarr_push_back(struct dynamic_array *array, int letter); +void dynarr_copy_array(struct dynamic_array *array, char *new_arr); +void dynarr_drop_word(struct dynamic_array *array); +void dynarr_clear(struct dynamic_array *array); + +#endif |