-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunc2.c
More file actions
57 lines (52 loc) · 1.58 KB
/
Copy pathfunc2.c
File metadata and controls
57 lines (52 loc) · 1.58 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* func2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: frcugy <frcugy@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/12/02 10:40:14 by frcugy #+# #+# */
/* Updated: 2014/12/02 10:43:07 by frcugy ### ########.fr */
/* */
/* ************************************************************************** */
#include "fdf.h"
void char_to_int(char ***tab, int ct, t_event e)
{
int **tob;
int *len;
int i;
int b;
int bob;
i = 0;
tob = (int**)malloc(sizeof(int*) * (ct + 1));
len = cnt_len(tab, ct);
while (tab[i])
{
bob = 0;
b = 0;
tob[i] = (int*)malloc(sizeof(int) * len[i]);
while (tab[i][b])
{
bob++;
tob[i][b] = ft_atoi(tab[i][b]);
b++;
}
e.bobo += bob;
len[i++] = bob;
}
start_print(tob, ct, len, e);
}
void double_to_triple(char **tab, int ct, t_event e)
{
char ***tab_final;
int i;
i = 0;
tab_final = (char***)malloc(sizeof(char**) * ct + 1);
while (tab[i])
{
tab_final[i] = ft_strsplit(tab[i], ' ');
i++;
}
tab_final[i] = NULL;
char_to_int(tab_final, ct, e);
}