aboutsummaryrefslogtreecommitdiff
path: root/test/main.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2025-07-10 19:44:04 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2025-07-10 19:44:04 +0300
commit645a8026b6f6a89cda5a24d96cf3de39c3ab32e1 (patch)
tree9388612433ba6a1325ece8a50830b9299e7cb598 /test/main.c
downloadngc-645a8026b6f6a89cda5a24d96cf3de39c3ab32e1.tar.gz
ngc-645a8026b6f6a89cda5a24d96cf3de39c3ab32e1.zip
initial commit
Diffstat (limited to 'test/main.c')
-rw-r--r--test/main.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/main.c b/test/main.c
new file mode 100644
index 0000000..489618b
--- /dev/null
+++ b/test/main.c
@@ -0,0 +1,19 @@
+#include <stdio.h>
+#include "vec.h"
+
+typedef ints = vec[int]();
+
+int main()
+{
+ struct ints a = intscreate();
+ for (size_t i = 0; i < 10; ++i)
+ intsappend(&a, i);
+
+ int sum = 0;
+ for (size_t i = 0; i < 10; ++i) {
+ sum += *intsat(&a, i);
+ }
+
+ printf("%i\n", sum);
+ intsdestroy(&a);
+}