-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2-main.c
39 lines (36 loc) · 1001 Bytes
/
2-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
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "hash_tables.h"
/**
* main - check the code
*
* Return: Always EXIT_SUCCESS.
*/
int main(void)
{
char *s;
unsigned long int hash_table_array_size;
hash_table_array_size = 1024;
s = "cisfun";
printf("%lu\n", hash_djb2((unsigned char *)s));
printf("%lu\n", key_index((unsigned char *)s, hash_table_array_size));
s = "Don't forget to tweet today";
printf("%lu\n", hash_djb2((unsigned char *)s));
printf("%lu\n", key_index((unsigned char *)s, hash_table_array_size));
s = "98";
printf("%lu\n", hash_djb2((unsigned char *)s));
printf("%lu\n", key_index((unsigned char *)s, hash_table_array_size));
return (EXIT_SUCCESS);
}
/*
julien@ubuntu:~/0x1A. Hash tables$ gcc -Wall -pedantic -Werror -Wextra -std=gnu89 2-main.c 1-djb2.c 2-key_index.c -o c
julien@ubuntu:~/0x1A. Hash tables$ ./c
6953392314605
237
3749890792216096085
341
5861846
470
julien@ubuntu:~/0x1A. Hash tables$
*/