I want to be able to read each row of this txt file using scanf() and assigning each column to an array.
220
01 01 5.00 1.50
02 01 4.00 3.00
02 02 3.00 4.00
03 01 4.50 3.00
03 01 7.50 2.50
03 01 6.00 0.50
04 01 2.00 3.00
04 02 2.00 3.00
05 01 1.50 3.00
07 01 5.00 1.00
09 01 1.50 6.00
-1
so far I only have:
#define MAXSIZE 100
int main(int argc, char *argv[]) {
int i;
int a, b;
double c, d, e;
int A[MAXSIZE], B[MAXSIZE];
double C[MAXSIZE], D[MAXSIZE
i = 0;
scanf("%d %d %lf %lf", &a, &b, &c, &d);
A[i] = a;
B[i] = b;
C[i] = b;
D[i] = d;
i+=1;
}
Is there any way I can do this?