blob: 2af91e26eab1b18dcf30b02a4f24fbe9780911dc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#include <stdio.h>
#include <stdlib.h>
#include <gevector.h>
GEVECTOR_DEF(int, ivec)
int
main(void)
{
ivec_t *vec = malloc(sizeof(ivec_t));
ivec_new(vec, 3, 0);
ivec_push(vec, 42);
ivec_push(vec, 69);
ivec_push(vec, 420);
ivec_insert(vec, 1337, 2);
for (size_t i = 0; i < vec->len; i++)
printf("%d\n", vec->data[i]);
ivec_free(vec);
free(vec);
}
|