This commit is contained in:
Camille Chauvet
2023-05-17 16:45:25 +00:00
commit 29ed24d567
619 changed files with 16119 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,43 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_range.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/21 18:54:20 by cchauvet #+# #+# */
/* Updated: 2022/08/01 17:19:30 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdlib.h>
int *ft_range(int min, int max)
{
int i;
int *tab;
tab = NULL;
if (max <= min)
return (tab);
tab = malloc(sizeof(*tab) * (max - min + 1));
i = 0;
while (min + i < max)
{
*(tab + i) = min + i;
i++;
}
return (tab);
}
#include <stdio.h>
int main(void)
{
int i;
i = 0;
while (i < 6)
{
printf("%d", ft_range(4, 10)[i]);
i++;
}
}