Files
42_INT_10_cube3d/libs/libft/srcs/ft_strcat.c
2022-05-04 14:38:34 +02:00

33 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/11/14 21:15:40 by hulamy #+# #+# */
/* Updated: 2019/03/25 15:12:58 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
/*
** append src to dest (dest must have sufficient space) and return dest
*/
#include "libft.h"
char *ft_strcat(char *dest, const char *src)
{
int i;
int j;
i = 0;
j = 0;
while (dest[i])
i++;
while (src[j])
dest[i++] = src[j++];
dest[i] = '\0';
return (dest);
}