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

BIN
Correction/C_07ma/ex01/a.out Executable file

Binary file not shown.

View File

@ -0,0 +1,55 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_range.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/21 18:54:20 by cchauvet #+# #+# */
/* Updated: 2022/07/28 19:25:51 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));
i = 0;
while (min + i < max)
{
*(tab + i) = min + i;
i++;
}
return (tab);
}
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
int i;
int min;
int max;
int *tab;
if (argc > 2)
{
i = 0;
min = atoi(argv[1]);
max = atoi(argv[2]);
tab = ft_range(min, max);
while (i < max - min)
{
printf("%d, ", *(tab + i));
i++;
}
}
}