Reading Files into arrays in C
Posted on 2002-03-18
How would i read info from a atext file into an array in C? I know how to do it in C++ as this is a lot easier:
But how do i do it in C using FILE?
I have tried the following but it just comes up with the same values in each position in the array.
while (fscanf(FilePtr,"%s %s",&S,&D) != -1)
Type[loop] = D;
Quant[loop] = S;