#include <stdlib.h>
int *ft_range(int min, int max)
{
int i;
int *result;
if (min >= max)
{
return (0);
}
i = max - min;
result = (int *)malloc(sizeof(int) * (i));
if (result == NULL)
{
return (NULL);
}
i = 0;
while (max > min)
{
result[i] = min;
min++;
i++;
}
return (result);
}
#include <stdio.h>
int main(void)
{
int min;
int max;
int *tab;
int i = 0;
int size;
min = 5;
max = 10;
size = max - min;
tab = ft_range(min, max);
while(i < size)
{
printf("%d, ", tab[i]);
i++;
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: