1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#include <stdio.h>
#include <stdlib.h>
#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;
}
|