38 lines
646 B
C
38 lines
646 B
C
#include <odweta/list.h>
|
|
#include <stdio.h>
|
|
|
|
int main(int argc, char **argv) {
|
|
list_t *l = listInit();
|
|
|
|
listPush(l, FLOAT, &(float){3.14});
|
|
listPush(l, CHAR, &(char){'x'});
|
|
listPush(l, INT, &(int){123});
|
|
|
|
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;
|
|
}
|