-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4-main.c
43 lines (40 loc) · 1.22 KB
/
4-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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "hash_tables.h"
/**
* main - check the code
*
* Return: Always EXIT_SUCCESS.
*/
int main(void)
{
hash_table_t *ht;
char *value;
ht = hash_table_create(1024);
hash_table_set(ht, "c", "fun");
hash_table_set(ht, "python", "awesome");
hash_table_set(ht, "Bob", "and Kris love asm");
hash_table_set(ht, "N", "queens");
hash_table_set(ht, "Asterix", "Obelix");
hash_table_set(ht, "Betty", "Cool");
hash_table_set(ht, "98", "Battery Street");
hash_table_set(ht, "c", "isfun");
value = hash_table_get(ht, "python");
printf("%s:%s\n", "python", value);
value = hash_table_get(ht, "Bob");
printf("%s:%s\n", "Bob", value);
value = hash_table_get(ht, "N");
printf("%s:%s\n", "N", value);
value = hash_table_get(ht, "Asterix");
printf("%s:%s\n", "Asterix", value);
value = hash_table_get(ht, "Betty");
printf("%s:%s\n", "Betty", value);
value = hash_table_get(ht, "98");
printf("%s:%s\n", "98", value);
value = hash_table_get(ht, "c");
printf("%s:%s\n", "c", value);
value = hash_table_get(ht, "javascript");
printf("%s:%s\n", "javascript", value);
return (EXIT_SUCCESS);
}