maxishell
Implementation of a shell for Linux-like systems
Loading...
Searching...
No Matches
ft_strcat_const.c File Reference
#include "libft.h"
Include dependency graph for ft_strcat_const.c:

Go to the source code of this file.

Functions

char * ft_strcat_const (const char *dest, const char *src)
 

Function Documentation

◆ ft_strcat_const()

char * ft_strcat_const ( const char *  dest,
const char *  src 
)

Definition at line 15 of file ft_strcat_const.c.

16{
17 int i;
18 int j;
19 char *result;
20
21 result = malloc(sizeof(char) * (ft_strlen(dest) + ft_strlen(src) + 1));
22 if (!result)
23 return (NULL);
24 i = 0;
25 while (dest[i] != '\0')
26 {
27 result[i] = dest[i];
28 i++;
29 }
30 j = 0;
31 while (src[j] != '\0')
32 {
33 result[i + j] = src[j];
34 j++;
35 }
36 result[i + j] = '\0';
37 return (result);
38}
size_t ft_strlen(const char *s)
Definition ft_strlen.c:15

References ft_strlen().

Referenced by check_operators().

Here is the call graph for this function:
Here is the caller graph for this function: