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