Data Structures Exos

This commit is contained in:
lclerel- lclerel-
2026-03-24 18:42:13 +01:00
parent 2e708093cf
commit 7c74a633a6
26 changed files with 545 additions and 887 deletions
@@ -0,0 +1,41 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strncat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lclerel- <lclerel-@learner.42.tech> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/03/24 18:04:58 by lclerel- #+# #+# */
/* Updated: 2026/03/24 18:39:31 by lclerel- ### ########.fr */
/* */
/* ************************************************************************** */
#include <unistd.h>
char *ft_strncat(char *dest, char *src, unsigned int nb)
{
unsigned int i;
unsigned int j;
i = 0;
j = 0;
while (dest[i])
i++;
while (src[j] && j < nb)
{
dest[i + j] = src[j];
j++;
}
dest[i + j] = '\0';
return (dest);
}
/*
int main(void)
{
char dst[100] = "Salut :3 ";
char src[] = "Je suis Lumi ^w^";
unsigned int nb = 26;
ft_strncat(dst, src, nb);
write(1, dst, 25);
}*/