libft
Functions
ft_strjoin.c File Reference
#include "libft.h"
+ Include dependency graph for ft_strjoin.c:

Go to the source code of this file.

Functions

char * ft_strjoin (const char *s1, const char *s2)
 Joins two strings. More...
 

Function Documentation

◆ ft_strjoin()

char* ft_strjoin ( const char *  s1,
const char *  s2 
)

Joins two strings.

Allocates (with malloc) and returns a “fresh” string ending with '\0', result of the concatenation of s1 and s2. If the allocation fails the function returns NULL.

Parameters
s1The prefix string.
s2The suffix string.
Returns
The “fresh” string result of the concatenation of the 2 strings.

Definition at line 26 of file ft_strjoin.c.