aboutsummaryrefslogtreecommitdiff
path: root/test.c
diff options
context:
space:
mode:
authorSoikk2022-01-28 22:30:34 +0100
committerSoikk2022-01-28 22:30:34 +0100
commitd21916ff6e651e1dd2f6cffbbca55076967e95bc (patch)
tree8cee845b15c6fb8e39b400a5650c09c180a0b921 /test.c
parent5d47f26c576430f29cd73b9e91863e8f259da3ab (diff)
downloadsoikk-llist.h-d21916ff6e651e1dd2f6cffbbca55076967e95bc.tar.xz
soikk-llist.h-d21916ff6e651e1dd2f6cffbbca55076967e95bc.tar.zst
Example and README added
Diffstat (limited to 'test.c')
-rw-r--r--test.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/test.c b/test.c
new file mode 100644
index 0000000..54a4727
--- /dev/null
+++ b/test.c
@@ -0,0 +1,25 @@
+// Usage of list
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "../libs/llist.h"
+
+typedef struct{
+ int a;
+ double b;
+} st;
+
+int main(){
+
+ st s1 = {.a = 1, .b = 2.0};
+ double c = 3.0;
+ node *n1 = Node(&s1, sizeof s1);
+ llist l = Llist("lista", NULL);
+
+ insert(&l, n1);
+ //l.head = n1;
+ printf("%d\n%f\n", ((st*)l.head->data)->a, s1.b);
+
+ return 0;
+
+}