This commit is contained in:
Camille Chauvet
2023-05-17 16:45:25 +00:00
commit 29ed24d567
619 changed files with 16119 additions and 0 deletions

View File

@ -0,0 +1,43 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strncat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jmendez <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/20 22:47:28 by jmendez #+# #+# */
/* Updated: 2022/07/25 16:53:34 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
char *ft_strncat(char *dest, char *src, unsigned int nb)
{
int i;
unsigned int j;
i = 0;
j = 0;
while (dest[i] != '\0')
i++;
while (j < nb)
{
dest[i] = src[j];
i++;
j++;
}
return (dest);
}
#include <string.h>
#include <stdio.h>
int main()
{
char a[] = "sss";
char b[] = "aaa";
char c[] = "aaa";
printf("%s", strncat(b, a, 5));
printf("\n%s", ft_strncat(c, a, 5));
}