Hi,
I have a simple comma delimited text file full of doubles such as
1,2,3,4,5
1,2,3,4,5
1,2,3,4,5
1,2,3,4,5
...
...
...etc
How would I read each "column" into an array in C?
I've tried something like this:
but the numbers are nonsense. I'm thinking that it's the newline that is messing it up. Any Suggestions?Code:for (i = 0; i < num_rows; i++) { fscanf(inf1, "%lf,%lf,%lf,%lf,%lf\n", &a[i], &b[i], &c[i], &d[i], &e[i]); }
Thanks!