made a better list demo

This commit is contained in:
Odweta
2023-12-23 18:37:49 +01:00
parent 3c5503d1cf
commit 29e1815e5b
2 changed files with 31 additions and 14 deletions
+10
View File
@@ -1,4 +1,5 @@
#include <odweta/list.h>
#include <odweta/vector.h>
#include <stdio.h>
int main() {
@@ -14,6 +15,15 @@ int main() {
printf("popped: %d\n", poppedValue);
listPrint(l);
printf("more examples with diferrent types\nnote that the vector_t* is a pointer, so there is no need to write the special syntax!\n");
listPush(l, FLOAT, &(float){3.14});
listPush(l, CHAR, &(char){'x'});
vector_t* int_vec = vectorInit(INT);
vectorPush(int_vec, &(int){456});
listPush(l, VECTOR, int_vec);
listPrint(l);
printf("if you are finished working with the list BEFORE the immediate end of the program, run 'listCleanup(list_t*)', otherwise it is not strictly necessary\n");
listCleanup(l);