int checkStatus(int manStatus[]) {
int i;
for(i = 0; i < ROWS; i++)
{
if(manStatus[i] == -1)
printf("Sorry, but %d is still single!\n", i);
return 1; //True
}
return 0; //False
}
the problem here in the if condition .. the compiler reads it as :
if manStatus[i] == -1 printf("string") else return 1;
so you are messing a curly bracket, try this :
int checkStatus(int manStatus[]) {
int i;
for(i = 0; i < ROWS; i++)
{
if(manStatus[i] == -1)
{
printf("Sorry, but %d is still single!\n", i);
return 1; //True
}
}
return 0; //False
}
and also when you are sending the manStatus in the while loop you are only sending the first element not the whole array so "checkStatus" function is always checking the first element over and over.. so it returns the same result over and over .. making the infinite loop you had before.
hope that helped.