/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* main.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: gbaconni +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2021/08/18 10:50:59 by gbaconni #+# #+# */ /* Updated: 2021/08/25 14:11:02 by gbaconni ### ########.fr */ /* */ /* ************************************************************************** */ #include #include #include #include char **ft_split(char *str, char *charset); int main(int argc, char *argv[]) { char **strs; char *str; char *charset; int i; if (argc < 2) { printf("%s \n", argv[0]); return (1); } str = argv[1]; charset = argv[2]; if (str[0] == '\0') str = NULL; strs = ft_split(str, charset); printf("str=%s charset=%s (ft_split)\n", str, charset); i = 0; while (strs[i][0] != '\0') { printf("strs[%d] = %s\n", i, strs[i]); i++; } free(strs); return (0); }