-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_arg_arr_bonus.c
30 lines (27 loc) · 1.24 KB
/
make_arg_arr_bonus.c
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* make_arg_arr_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sanglee2 <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/05/29 21:18:07 by sanglee2 #+# #+# */
/* Updated: 2023/05/29 22:15:27 by sanglee2 ### ########.fr */
/* */
/* ************************************************************************** */
#include "push_swap_bonus.h"
void make_arg_arr(t_deq* deq_a)
{
deq_a->arr =(int *)malloc(sizeof(int) * deq_a->a_size);
if(!deq_a->arr)
return ; // 더 관련해서 작업해줄지 말지에 대해 생각
int i;
t_node *temp;
i = 0;
temp = deq_a->a_top;
while (temp)
{
deq_a->arr[i++] = temp->content;
temp = temp->next;
}
}