it need to end when i==size
or when the input is wrong
i dont need to return anything in the end except the recursive call
i changed the code so the recursive call will go to some variable
but the warning keeps showing
what case i missed??
Code:
#include <stdio.h>
int read_array(int input[],int i,int size);
int main()
{
int input[40];
printf("%d",read_array(input,0,8));
}
int read_array(int input[],int i,int size)
{
int flag,rt;
if (i==size-1)
{
return 1;
}
flag=scanf("%d",&input[i]);
if (flag==0)
{
return 0;
}
else
{
}
rt=read_array(input,i+1,size);
}