0
0
This commit is contained in:
2021-08-19 08:28:25 +02:00
parent 0f3c227c01
commit 0e8898635b
8 changed files with 118 additions and 6 deletions

View File

@@ -11,7 +11,6 @@
/* ************************************************************************** */
#include <stdlib.h>
#include <stdio.h>
int *ft_range(int min, int max)
{
@@ -20,10 +19,10 @@ int *ft_range(int min, int max)
int i;
if (min < max)
size = max - min;
size = (max - min) + 1;
else
return (NULL);
range = (int *) malloc(size * sizeof(char));
range = (int *) malloc(size * sizeof(int));
i = 0;
while (i < size)
{

View File

@@ -32,10 +32,9 @@ int main(void)
printf("Input Max: ");
scanf("%d", &max);
result = ft_range(min, max);
size = 0;
while (result[size++])
continue ;
printf("min=%d max=%d (ft_range)\nresult:\n", min, max);
size = (max - min) + 1;
printf("size=%d\n", size);
i = 0;
while (i < size)
{