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