42_libft/main.c
Camille Chauvet 26b7aed203 final maybe
2022-10-04 23:01:49 +02:00

36 lines
1.3 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 13:56:50 by cchauvet #+# #+# */
/* Updated: 2022/10/04 22:58:20 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdio.h>
#include "libft.h"
int main(int argc, char **argv)
{
char **splitted;
char *a;
char c;
if (argc < 2)
return (1);
a = argv[1];
c = argv[2][0];
splitted = ft_split(a, c);
//splitted = ft_split("lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse", ' ');
while (*splitted != NULL)
{
puts(*splitted);
free(*splitted);
splitted++;
}
return (0);
}