38 lines
1.4 KiB
C
38 lines
1.4 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* main.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2021/08/12 15:16:20 by gbaconni #+# #+# */
|
|
/* Updated: 2021/08/18 12:00:04 by gbaconni ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include <stdio.h>
|
|
#include <unistd.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
int ft_strncmp(char *s1, char *s2, unsigned int n);
|
|
|
|
int main(void)
|
|
{
|
|
char *s1 = "a";
|
|
char *s2 = "a";
|
|
unsigned int n = 65536;
|
|
int result;
|
|
|
|
while (n < 80000)
|
|
{
|
|
printf("[%d]:\n", n);
|
|
result = strncmp(s1, s2, n);
|
|
printf("s1=%s s2=%s n=%d result=%d (strncmp)\n", s1, s2, n, result);
|
|
result = ft_strncmp(s1, s2, n);
|
|
printf("s1=%s s2=%s n=%d result=%d (ft_strncmp)\n", s1, s2, n, result);
|
|
n++;
|
|
}
|
|
return (0);
|
|
}
|