reading string and integers from a text file
I am trying to read a text filewith an 'unknown' number of name strings and integer test scores. this is the latest attempt. I only get the first character instead of the string.
int ReadFile ( char *CharArrayPtr, int *IntArrayPtr )
{
int RecordCount = 0;
rewind ( fin );
while ( fgets ( &CharArrayPtr[RecordCount], 13, fin ))
{
fscanf ( fin, "%d", &IntArrayPtr[RecordCount] );
RecordCount ++;
}
close (fin );
return ( RecordCount );
}
CharArrayPtr is a pointer to a 2D array for the name strings. IntArrayPtr is for the test scores. fin is the pointer to my text file.