1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include <assert.h> #define VEC_TYPE int #define VEC_NAME ints #include <conts/vec.h> int main() { struct ints ints = ints_create(0); for (int i = 0; i < 1000000; ++i) { ints_append(&ints, i); } for (int i = 0; i < 1000000; ++i) { int *v = ints_at(&ints, i); assert(v && *v == i); } ints_destroy(&ints); }