-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
36 lines (33 loc) · 1.24 KB
/
main.c
File metadata and controls
36 lines (33 loc) · 1.24 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
/* ************************************************************************** */
/* */
/* :::::::: */
/* main.c :+: :+: */
/* +:+ */
/* By: candace <candace@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2022/05/30 09:41:39 by candace #+# #+# */
/* Updated: 2022/10/19 15:47:29 by cstaats ######## odam.nl */
/* */
/* ************************************************************************** */
#include "pushswap.h"
int main(int argc, char **argv)
{
int *stacktemp;
int *stacka;
errorcheck(argc, argv);
stacktemp = errorchecks(argc, argv);
stacka = indexarray(stacktemp, argc - 1);
free(stacktemp);
if (argc < 3)
{
free(stacka);
return (0);
}
if (amisorted(stacka, argc - 1) == 1)
{
free(stacka);
return (0);
}
else
(whichmethod(stacka, argc - 1));
}