summary refs log tree commit diff
path: root/src/main.c
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-03 13:23:44 +0100
committerBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-03 13:23:44 +0100
commit416d009ffaead754fc13bd6f2093f6c65c17fa95 (patch)
tree0e6471f6477588f6b4cd365f049cb0746c9bcee1 /src/main.c
parentInitial commit (diff)
downloadc-hashtable-416d009ffaead754fc13bd6f2093f6c65c17fa95.tar.gz
c-hashtable-416d009ffaead754fc13bd6f2093f6c65c17fa95.tar.bz2
c-hashtable-416d009ffaead754fc13bd6f2093f6c65c17fa95.zip
Kind of works~
Diffstat (limited to '')
-rw-r--r--src/main.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/src/main.c b/src/main.c
index d1d84bf..55b2b9e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -6,21 +6,33 @@ int main(int argc, char** argv) {
 
 	HashTable ht = hashtable_init();
 
-	char res = hashtable_get(ht, 'a');
+	char* res = (char*) hashtable_get(ht, "a");
 
-	printf("Result: %c\n", res);
+	printf("Result: %s\n", res);
 
-	hashtable_put(ht, 'a', 'x');
-	
-	res = hashtable_get(ht, 'a');
+	hashtable_put(ht, "aa", (void*)"x");
 
-	printf("Result: %c\n", res);
-	
-	hashtable_put(ht, 'h', '1');
-	
-	res = hashtable_get(ht, 'a');
+	res = hashtable_get(ht, "aa");
+
+	printf("Result: %s\n", res);
+
+	hashtable_put(ht, "b", (void*)"1");
+
+	printf("This should still be x\n");
+
+	res = hashtable_get(ht, "aa");
+
+	printf("Result: %s\n", res);
 	
-	printf("Result: %c\n", res);
+	res = hashtable_get(ht, "b");
+
+	printf("Result: %s\n", res);
+
+	hashtable_remove(ht, "b");
+
+	res = hashtable_get(ht, "b");
+
+	printf("Result: %s\n", res);
 
 	hashtable_deinit(&ht);