20 lines
399 B
C
20 lines
399 B
C
#include <stdlib.h>
|
|
struct da_template {
|
|
void *items;
|
|
int count;
|
|
int capacity;
|
|
};
|
|
|
|
void *dyn_array_create() {
|
|
struct da_template *da = malloc(sizeof(struct da_template));
|
|
da->items = malloc(0);
|
|
da->count = 0;
|
|
da->capacity = 0;
|
|
return da;
|
|
}
|
|
void dyn_array_create_inplace(void *array) {
|
|
struct da_template *da = array;
|
|
da->items = malloc(0);
|
|
da->count = 0;
|
|
da->capacity = 0;
|
|
}
|