made a better list demo
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user