41 lines
1.4 KiB
C
41 lines
1.4 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* main.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: gbaconni <gbaconni@42lausanne.ch> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2021/08/18 10:50:59 by gbaconni #+# #+# */
|
|
/* Updated: 2021/08/24 11:56:21 by gbaconni ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include <stdio.h>
|
|
#include <unistd.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
char **ft_split(char *str, char *charset);
|
|
|
|
int main(void)
|
|
{
|
|
char str[32];
|
|
char charset[32];
|
|
char **strs;
|
|
int i;
|
|
|
|
printf("Input String [Max 32]: ");
|
|
scanf("%s", str);
|
|
printf("Input Charset [Max 32]: ");
|
|
scanf("%s", charset);
|
|
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++;
|
|
}
|
|
return (0);
|
|
}
|