31 lines
571 B
C
31 lines
571 B
C
#include <odweta/list.h>
|
|
#include <stdio.h>
|
|
|
|
int main() {
|
|
list_t* l = listInit();
|
|
|
|
listPush(l, INT, &(int){5});
|
|
listPush(l, INT, &(int){2});
|
|
listPush(l, INT, &(int){1});
|
|
|
|
listSetAt(l, 1, FLOAT, &(float){3.14});
|
|
|
|
printf("value at index 2 in list l:\n");
|
|
int val = *((int*)listGetAt(l, 2));
|
|
printf("%d\n", val);
|
|
|
|
list_t* m = listInit();
|
|
|
|
listPush(m, CHAR, &(char){'a'});
|
|
listPush(m, CHAR, &(char){'b'});
|
|
listPush(m, CHAR, &(char){'c'});
|
|
|
|
listSetAt(l, 2, LIST, m);
|
|
|
|
listPrint(l);
|
|
|
|
listCleanup(l);
|
|
|
|
return 0;
|
|
}
|