made popping with lists work. yay! (also new demo to show the thing)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user