-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_range.c
More file actions
31 lines (28 loc) · 1.12 KB
/
ft_range.c
File metadata and controls
31 lines (28 loc) · 1.12 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_range.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gfoote <gfoote@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/06 13:51:00 by gfoote #+# #+# */
/* Updated: 2019/04/11 12:13:42 by gfoote ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int *ft_range(int min, int max)
{
int *result;
int i;
if (min >= max)
return (0);
result = (int*)(malloc((max - min) * sizeof(int)));
i = 0;
while (max - min > 0)
{
result[i] = min;
min++;
i++;
}
return (result);
}