42_libft/main.c
Camille Chauvet d4bc0e05a5 d
2022-10-04 22:04:23 +02:00

35 lines
1.2 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 13:56:50 by cchauvet #+# #+# */
/* Updated: 2022/10/04 21:20:44 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);
while (*splitted != NULL)
{
puts(*splitted);
free(*splitted);
splitted++;
}
return (0);
}