Problem with fscanf statement
Hi this is my first time doing this, but I am having trouble with my fscanf statement.
The text file that I am trying to read looks like this:
0 1 1
1 1 1
2 1 1
3 1 1
4 1 1
5 1 1
6 1 1
7 1 1
8 1 1
9 1 1
and I am trying to read the first number in each line as "i" and the second one as what x[i] equals and the third as what y[i] equals.
here is the fscanf statement i'm using right now:
inp = fopen ("input-xy.txt", "r");
input_status = fscanf(inp, "%d %f %f", &i, &x[i], &y[i]);
but when i try to print these numbers out, I get a segmentation fault.
Any ideas?
-----Julian