libft
ft_strcat.c
Go to the documentation of this file.
1 /* ************************************************************************** */
3 /* */
4 /* ::: :::::::: */
5 /* ft_strcat.c :+: :+: :+: */
6 /* +:+ +:+ +:+ */
7 /* By: unite <marvin@42.fr> +#+ +:+ +#+ */
8 /* +#+#+#+#+#+ +#+ */
9 /* Created: 2019/09/04 23:05:52 by unite #+# #+# */
10 /* Updated: 2020/07/16 02:51:31 by unite ### ########.fr */
11 /* */
12 /* ************************************************************************** */
13 
14 #include "libft.h"
15 
20 char *ft_strcat(char *s1, const char *s2)
21 {
22  size_t i;
23  size_t len;
24 
25  len = ft_strlen(s1);
26  i = 0;
27  while (s2[i])
28  {
29  s1[len + i] = s2[i];
30  i++;
31  }
32  s1[len + i] = '\0';
33  return (s1);
34 }
ft_strlen
size_t ft_strlen(const char *s)
Replicates behaviour of strlen from libc.
Definition: ft_strlen.c:20
ft_strcat
char * ft_strcat(char *s1, const char *s2)
Replicates behaviour of strcat from libc.
Definition: ft_strcat.c:20
libft.h