Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
426 B
2
Indexable
Never
#include <unistd.h>
#include <stdlib.h>

char	*ft_strjoin(int size, char **strs, char *sep)
{
	int		i;
	int		word;
	char	*point;
	int		all;

	point = malloc(sizeof(strs));
	all = 0;
	word = 0;
	while (word < size)
	{
		i = 0;
		while (strs[word][i])
		{
			point[all++] = strs[word][i++];
		}
		i = 0;
		while (sep[i] && word != size - 1)
		{
			point[all++] = sep[i++];
		}
		word++;
	}
	point[all] = '\0';
	return (point);
}