void user_input (int * array, int intSize)
{
printf("Please enter any number of strings (80 characters per string max), enter an empty string to signal input completion\n\n");
int i = 0;
int j = 0;
int arrayMax = MAXARRAY - 1;
char input[81];
while (input[0] != '\0')
{
printf("->");
i = 0;
while((input[i] = getchar())!= i < 80 && '\n')
{
i++;
}
if(input[i] != '\0')
input[i] = '\0';
if(j == arrayMax)
{
realloc_data_up(array, intSize);
arrayMax = MAXARRAY + arrayMax;
}
array[j] = atoi(input);
j++;
}
realloc_data_down(array, j, intSize);
}
input should terminate when the user enters a blank string, (a null '\0'). But it doesnt work, i'm probably not seeing some small detail.
Any help is greatly appreciated.