**EDIT**
New help needed please see below
Please be gently i'm still struggling to get to grips with C
Basicly i want to read from my file.
I put the first line as the Resis
Second line will be Temps
So it loops though adding the lines from my file to the ResisB and TempsB varribles then adds them to the correct arrays.
except this it's getting stuck on the
Code:
if ( fscanf( secretFile, "%d", ResisB ) == EOF )
break;
I need the data in the arrays to be the same as the data in the file, because later i will need to compare some results with data in the ResisA array. Because i will be finding the nearest similar result to what i havei n the array. But i can't do this if i can't get the data in the arrays.
Example Data
Code:
335000
-50
168000
-40
Code:
int main( void )
int ResisA[3];
int ResisB;
int TempsA[3];
int TempsB;
FILE *secretFile = NULL;
int counter;
int main( void )
{
secretFile = fopen( "table.txt", "r" );
if ( secretFile == NULL )
return 0;
for ( counter = 0; counter < 10; counter++ )
{
if ( fscanf( secretFile, "%d", ResisB ) == EOF )
break;
if ( fscanf( secretFile, "%d", TempsB ) == EOF )
break;
ResisA[ counter ] = ResisB;
TempsA[ counter ] = TempsB;
}
}