CPlay/hashmap/main.c
2025-06-15 21:20:40 +02:00

23 lines
446 B
C

#include "hashmap.h"
#include <stdio.h>
int main() {
hashmap_t *map = hashmap_create(128);
int value1 = 42;
hashmap_put(map, "answer", &value1);
int *found = hashmap_get(map, "answer");
if (found) {
printf("Found: %d\n", *found);
}
hashmap_remove(map, "answer");
found = hashmap_get(map, "answer");
if (!found) {
printf("Entry removed.\n");
}
hashmap_destroy(map);
return 0;
}