Automatic add

This commit is contained in:
Timo Schmidt 2023-03-28 15:52:53 +02:00
parent fb05097cff
commit be02e1198a
1 changed files with 13 additions and 13 deletions

View File

@ -6,20 +6,20 @@
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */ /* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/24 02:04:46 by tischmid #+# #+# */ /* Created: 2023/03/24 02:04:46 by tischmid #+# #+# */
/* Updated: 2023/03/24 02:20:19 by tischmid ### ########.fr */ /* Updated: 2023/03/28 15:52:50 by tischmid ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
char *ft_strcat(char *s1, char *s2) char *ft_strcat(char *dest, char *src)
{ {
char *orig_s1; char *orig_s1;
orig_s1 = s1; orig_s1 = dest;
while (*s1) while (*dest)
++s1; ++dest;
while (*s2) while (*src)
*s1++ = *s2++; *dest++ = *src++;
*s1 = 0; *dest = 0;
return (orig_s1); return (orig_s1);
} }
@ -30,11 +30,11 @@ char *ft_strcat(char *s1, char *s2)
int main(void) int main(void)
{ {
char s1[] = STR1; char dest[] = STR1;
char s2[] = STR2; char src[] = STR2;
printf("s1: %s s2: %s\n", s1, s2); printf("dest: %s src: %s\n", dest, src);
ft_strcat(s1, s2); ft_strcat(dest, src);
printf("s1: %s s2: %s\n", s1, s2); printf("dest: %s src: %s\n", dest, src);
return (0); return (0);
} }
*/ //// */ ////