/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ex00.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: achubuko +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/11/29 19:42:18 by achubuko #+# #+# */ /* Updated: 2023/11/29 22:09:07 by achubuko ### ########.fr */ /* */ /* ************************************************************************** */ #include #include #define TEST_BUF_SIZE 100 int ft_strcmp(char *s1, char *s2); int main(void) { char s[TEST_BUF_SIZE] = "Hello World!"; char d1[TEST_BUF_SIZE] = "Hello World!"; char d2[TEST_BUF_SIZE] = "Hello Sarld!"; int r1; int r2; printf("initial strings:\n"); dump(s, 20); dump(d1, 20); dump(d2, 20); printf("strcmp(d2, s):\n"); r1 = strcmp(d2, s); r2 = ft_strcmp(d2, s); printf("return values: orig: %i ft: %i\n", r1, r2); printf("strcmp(s, d2):\n"); r1 = strcmp(s, d2); r2 = ft_strcmp(s, d2); printf("return values: orig: %i ft: %i\n", r1, r2); printf("strcmp(s, d1):\n"); r1 = strcmp(s, d1); r2 = ft_strcmp(s, d1); printf("return values: orig: %i ft: %i\n", r1, r2); return 0; }