Perhaps you should remove the \t from the formatstring. I'm not sure, but aren't tabs in text-files replaced by spaces? In that case you only need %d to read integer values. Personally I would use %d to get the integer values instead of reading the whole line as a string.
I guess something like this should work:
Code:
FILE *textfile;
int a, b, c;
fscanf(textfile, "%d%d%d", &a, &b, &c);
By the way, you forgot to return a return value at the end of main. And I would not use exit(0). But do something like:
Code:
if ((textfile=fopen("test.txt", "r")) == NULL)
{
printf ("Error opening text file for reading\n");
return_value = 0;
}
else
{
/* file is opened for reading */
....
return_value = 1;
}
return return_value;