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,50 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_ultimate_range.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/22 10:33:24 by cchauvet #+# #+# */
/* Updated: 2022/08/01 17:27:36 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdlib.h>
int ft_ultimate_range(int **range, int min, int max)
{
int i;
*range = NULL;
if (max <= min)
return (0);
*range = malloc(sizeof(*range) * (max - min + 1));
i = 0;
while (min + i < max)
{
(*range)[i] = min + i;
i++;
}
return (max - min);
}
#include <stdio.h>
int main(void)
{
int temp1;
int *temp2;
int **tab;
temp1 = 0;
temp2 =&temp1;
tab = &temp2;
printf("%d", ft_ultimate_range(tab, 11, 10));
printf("\n");
for (int ind = 0; ind<10; ind++ )
{
printf("%i, ", (*tab)[ind]);
}
return (0);
}