39 lines
1.2 KiB
C
39 lines
1.2 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_strcpy.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2022/07/16 15:08:22 by cchauvet #+# #+# */
|
|
/* Updated: 2022/07/20 13:12:32 by cchauvet ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
char *ft_strcpy(char *dest, char *src)
|
|
{
|
|
while (*src != '\0')
|
|
{
|
|
*dest = *src;
|
|
src++;
|
|
dest++;
|
|
}
|
|
*dest = '\0';
|
|
return (dest);
|
|
}
|
|
/*
|
|
int main(void)
|
|
{
|
|
char dest[1];
|
|
char dest1[1];
|
|
char src[] = "abcde";
|
|
|
|
ft_strcpy(dest, src);
|
|
printf("%s \n\n", dest);
|
|
strcpy(dest1, src);
|
|
printf("%s \n\n", dest);
|
|
|
|
return (0);
|
|
}
|
|
*/
|