Derive-C
Loading...
Searching...
No Matches
readme.c
Go to the documentation of this file.
1#include <stdio.h>
2
3#define CAPACITY 2048
4#define NAME alloc_2048
6
7#define ITEM char
8#define ALLOC alloc_2048
9#define NAME vec_char
11
12int main() {
13 alloc_2048_buffer buf;
14 alloc_2048 alloc = alloc_2048_new(&buf);
15 vec_char vec = vec_char_new(&alloc);
16
17 for (char x = 1; x <= 9; x++) {
18 vec_char_push(&vec, (char)('0' + x));
19 }
20
21 vec_char_iter_const iter = vec_char_get_iter_const(&vec);
22 char const* entry;
23 while ((entry = vec_char_iter_const_next(&iter))) {
24 printf("entry: %c\n", *entry);
25 }
26
27 vec_char_delete(&vec);
28}
int main()
Definition readme.c:12