forked from kaloi-noggins/trabson-eda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
29 lines (21 loc) · 826 Bytes
/
main.c
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
#include <stdlib.h>
#include <stdio.h>
#include "hashmap.h"
int main(){
hashmap *map = hashmap_create(512);
hashmap_set(map, "lorem", 1);
hashmap_set(map, "ipsum", 2);
hashmap_set(map, "dolor", 3);
hashmap_set(map, "sit", 4);
hashmap_set(map, "amet", 5);
printf("map['%s'] = %i\n", "lorem", hashmap_get(map, "lorem"));
printf("map['%s'] = %i\n", "ipsum", hashmap_get(map, "ipsum"));
printf("map['%s'] = %i\n", "amet", hashmap_get(map, "amet"));
printf("has('%s') = %i\n", "amet", hashmap_has(map, "amet"));
printf("has('%s') = %i\n", "pedro", hashmap_has(map, "pedro"));
printf("size: %i\n", hashmap_size(map));
hashmap_remove(map, "lorem");
printf("size: %i\n", hashmap_size(map));
hashmap_delete(map);
return EXIT_SUCCESS;
}