42_libft/main.c

35 lines
1.2 KiB
C
Raw Normal View History

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 16:04:23 -04:00
/* Updated: 2022/10/04 21:20:44 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 08:21:55 -04:00
while (*splitted != NULL)
{
puts(*splitted);
free(*splitted);
splitted++;
}
return (0);
2022-09-27 11:25:41 -04:00
}