aboutsummaryrefslogtreecommitdiff
path: root/c09/main.c
blob: 02c5a614f9aa923f87eb584c0a3959c3f06b59bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ex02/ft_split.c"

int main()
{
	char *const str = "3YaZkAP30iGoBWv L  asdf  h LbpX8Hx FWHwB2u1FH0S5";
	char *begin = "\n \t hgonjour";
	char *end = "jesuis\n\t   hhh";
	char *empty = "    h bonjour je    suis             ";
	char *charset = "\n\t";
	char **strs = ft_split(end, charset);
	printf("tab start\n");
	for (int i = 0; strs[i] != 0; i++)
	{
		printf("tab[%d]: %s\n", i, strs[i]);
		/*for (int j = 0; j < 10; j++)*/
			/*printf("%d ", strs[i][j]);*/
	}
	printf("tab end\n");
	for (int i = 0; strs[i] != 0; i++)
		free(strs[i]);
	free(strs);

	return 0;
}