From 6a564da0f9c510c0222b05ba5da18c6ef73e8030 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 3 Apr 2024 15:16:39 -0300 Subject: map implementado --- main.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 main.c (limited to 'main.c') diff --git a/main.c b/main.c new file mode 100644 index 0000000..0f0d650 --- /dev/null +++ b/main.c @@ -0,0 +1,38 @@ +#include +#include + +#include "include/map.h" + +#define EXT_ERR_PARAMS 1 +int main(int argc, char *argv[]){ + string_map special_char = init_map(1024); + + insert_map("aa", "aa", special_char); + insert_map("d", "d", special_char); + + char *test = get_value("aa", special_char); + printf("%s\n", test); + test = get_value("d", special_char); + printf("%s\n", test); + test = get_value("d", special_char); + printf("%s\n", test); + test = get_value("aa", special_char); + printf("%s\n", test); + /* + if(argc != 2){ + fprintf(stderr, "passe o nome do arquivo\n"); + exit(EXT_ERR_PARAMS); + } + + char *file_path = argv[1]; + FILE *fp = fopen(file_path, "r"); + + char tmp; + while(fscanf(fp, "%c", &tmp) != EOF){ + printf("%c", tmp); + } + + fclose(fp); + */ + return 0; +} -- cgit v1.2.3