diff options
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -0,0 +1,29 @@ +#include "Array.h" +#include "BumpAlloc.h" +#include "GlobalArena.h" +#include "String.h" +#include <stdio.h> + +int +main() { + g_arena = Bcreate(KiB(4)); + + int *nums = Array_Gnew(sizeof(int), 8); + for (int i = 10; i < 20; ++i) { + Array_push(nums, &i); + } + + printf("%lu/%lu |", Array_count(nums), Array_length(nums)); + for (int i = 0; i < Array_count(nums); ++i) + printf(" %d", nums[i]); + printf("\n"); + + String s = String_Gconcat("Hello", " ", "World", "!", NULL); + printf("%s\n", s); + + String s1 = String_Gprintf("%s #%d\n", s, 5); + printf("%s\n", s1); + + Bdestroy(g_arena); + return 0; +} |
