Would a message saying Thread stopped be due to a file being unable to be opened or code being written wrong. Here's my problem.
void read(name_t name[], int *num_records)
{
int i;
int flag = 3;
FILE *input;
input = fopen("file1", "r");
check_file(input, "file1");
while(flag != EOF && flag ==3 && i<MAXIMUM)
{
fscanf(input, "%s %s", &name[i].last, &name[i].first);
fscanf(input, "%s", &name[i].given_name);
i++;
}
*num_records = i - 1;
fclose(input);
}
I am getting a thread stopped at the first fscanf.