]> git.xolatile.top Git - soikk-llist.h.git/commitdiff
Example and README added
authorSoikk <soikk@1005PE.my.domain>
Fri, 28 Jan 2022 21:30:34 +0000 (22:30 +0100)
committerSoikk <soikk@1005PE.my.domain>
Fri, 28 Jan 2022 21:30:34 +0000 (22:30 +0100)
README.md [new file with mode: 0644]
test.c [new file with mode: 0644]

diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..ff88ee1
--- /dev/null
+++ b/README.md
@@ -0,0 +1 @@
+Usage of list shown in "test.c"
diff --git a/test.c b/test.c
new file mode 100644 (file)
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;
+       
+}