Created a list structure for strings. Should work for splitting lines of text up just before they're tokenized.

This commit is contained in:
2021-12-30 14:28:02 -06:00
parent 9c6b1d9057
commit 168d8e1548
3 changed files with 78 additions and 1 deletions
+15 -1
View File
@@ -1,6 +1,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "../includes/list.h"
typedef struct opcode {
char op[255];
@@ -24,7 +25,20 @@ int main(int argc, char* args[]) {
// print_file(args[i]);
// }
print_file(args[1]);
//print_file(args[1]);
char str[16];
List *list = CreateList();
for (int i = 0; i < 64; i++) {
sprintf(str, "%d", i);
AddListItem(str, list);
if (i % 4 == 0) printf("Size: %d; Capacity: %d\n", list->size, list->capacity);
}
PrintList(list);
free(list);
}
void print_file(char* file_path) {