made examples/demos for vectors && files && lists | also fixed a bug with the vector and list size and popping, explained in the adjacent comment
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
#include <odweta/file.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
printf("creating a file using 'fileInit(<filename>)' (returns a file_t*)\n");
|
||||
file_t* f = fileInit("test.txt");
|
||||
|
||||
printf("printing the file contents\n\n");
|
||||
filePrint(f);
|
||||
|
||||
printf("\nconvering the file contents into a string (char*)\n");
|
||||
char* string = fileToString(f);
|
||||
printf("\"%s\"\n", string);
|
||||
|
||||
// TODO -> writing, clearing
|
||||
|
||||
printf("if you are finished working with the file BEFORE the immediate end of the program, run 'fileCleanup(file_t*)', otherwise it is not strictly necessary\n");
|
||||
fileCleanup(f);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user