I'm basically using the C function, fscanf() to read in data from a file. using fopen and checking it I know the file is being opened successfully by checking the return value.
The file is formatted with Char, Int, Int. The issue I have is I can only read in one line at a time and the loop exits. Would appreciate if anyone could see where I am going wrong
char c;
char nl;
int t1, t2;
int dataTest;
do
{
dataTest = fscanf(fp, "%c %d %d", &c, &t1, &t2);
fscanf(fp, "%c", &nl);
printf("%c %d %d \n", c, t1, t2);
if (dataTest = -1)
{
break;
}
}while(1);