37 lines
1.2 KiB
C
37 lines
1.2 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_strcpy.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/03/19 05:59:56 by tischmid #+# #+# */
|
|
/* Updated: 2023/03/24 01:05:46 by tischmid ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
char *ft_strcpy(char *s1, char *s2)
|
|
{
|
|
int i;
|
|
|
|
i = -1;
|
|
while (s2[++i] != '\0')
|
|
s1[i] = s2[i];
|
|
s1[i] = '\0';
|
|
return (s1);
|
|
}
|
|
|
|
/* ////
|
|
#include <stdio.h>
|
|
#define BUFSIZE 10
|
|
|
|
int main(void)
|
|
{
|
|
char s1[BUFSIZE];
|
|
|
|
ft_strcpy(s1, "0123456789");
|
|
printf("%s\n", s1);
|
|
return (0);
|
|
}
|
|
*/ ////
|