|
| 1 | +#include <stdlib.h> |
| 2 | +#include <string.h> |
| 3 | +#include <stdio.h> |
| 4 | +#include "hash_tables.h" |
| 5 | + |
| 6 | +/** |
| 7 | + * main - check the code |
| 8 | + * |
| 9 | + * Return: Always EXIT_SUCCESS. |
| 10 | + */ |
| 11 | +int main(void) |
| 12 | +{ |
| 13 | + hash_table_t *ht; |
| 14 | + char *value; |
| 15 | + |
| 16 | + ht = hash_table_create(1024); |
| 17 | + hash_table_set(ht, "c", "fun"); |
| 18 | + hash_table_set(ht, "python", "awesome"); |
| 19 | + hash_table_set(ht, "Bob", "and Kris love asm"); |
| 20 | + hash_table_set(ht, "N", "queens"); |
| 21 | + hash_table_set(ht, "Asterix", "Obelix"); |
| 22 | + hash_table_set(ht, "Betty", "Cool"); |
| 23 | + hash_table_set(ht, "98", "Battery Street"); |
| 24 | + hash_table_set(ht, "c", "isfun"); |
| 25 | + |
| 26 | + value = hash_table_get(ht, "python"); |
| 27 | + printf("%s:%s\n", "python", value); |
| 28 | + value = hash_table_get(ht, "Bob"); |
| 29 | + printf("%s:%s\n", "Bob", value); |
| 30 | + value = hash_table_get(ht, "N"); |
| 31 | + printf("%s:%s\n", "N", value); |
| 32 | + value = hash_table_get(ht, "Asterix"); |
| 33 | + printf("%s:%s\n", "Asterix", value); |
| 34 | + value = hash_table_get(ht, "Betty"); |
| 35 | + printf("%s:%s\n", "Betty", value); |
| 36 | + value = hash_table_get(ht, "98"); |
| 37 | + printf("%s:%s\n", "98", value); |
| 38 | + value = hash_table_get(ht, "c"); |
| 39 | + printf("%s:%s\n", "c", value); |
| 40 | + value = hash_table_get(ht, "javascript"); |
| 41 | + printf("%s:%s\n", "javascript", value); |
| 42 | + return (EXIT_SUCCESS); |
| 43 | +} |
0 commit comments