made popping with lists work. yay! (also new demo to show the thing)

This commit is contained in:
Odweta
2023-12-22 14:27:07 +01:00
parent ea527405e5
commit 45732c4b22
5 changed files with 47 additions and 14 deletions
+22
View File
@@ -1,4 +1,5 @@
#include <odweta/list.h>
#include <stdio.h>
int main(int argc, char **argv) {
list_t *l = listInit();
@@ -9,6 +10,27 @@ int main(int argc, char **argv) {
listPrint(l);
printf("popping for the 1st time\n");
int popped = *((int *)listPop(l));
printf("popped: %d\n", popped);
listPrint(l);
printf("popping for the 2nd time\n");
char cpopped = *((char *)listPop(l));
printf("popped: '%c'\n", cpopped);
listPrint(l);
printf("popping for the 3rd time\n");
float fpopped = *((float *)listPop(l));
printf("popped: %f\n", fpopped);
listPrint(l);
listCleanup(l);
return 0;