37 lines
1.2 KiB
C
37 lines
1.2 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_strcpy.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: sgongas <sgongas@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2026/02/22 23:31:17 by sgongas #+# #+# */
|
|
/* Updated: 2026/02/22 23:38:22 by sgongas ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
char *ft_strcpy(char *dest, char *src)
|
|
{
|
|
int i;
|
|
|
|
i = 0;
|
|
while (src[i])
|
|
{
|
|
dest[i] = src[i];
|
|
i++;
|
|
}
|
|
dest[i] = '\0';
|
|
return (dest);
|
|
}
|
|
|
|
// #include <stdio.h>
|
|
|
|
// int main(void)
|
|
// {
|
|
// char src[] = "hello";
|
|
// char dest[10];
|
|
|
|
// ft_strcpy(dest, src);
|
|
// printf("%s", dest);
|
|
// return (0);
|
|
// }
|