fscanf reading into a double array strange values
The following code has the intent of reading doubles from a file and putting them into an array. Quite simple.

	double arr[100];
	int i = 0; 

	while(fscanf(fin, "%lf", &arr[i]) != EOF) 
		i++;

However when I print the array I get weird values. If I substitute the array variable with a regular double variable and inside the previously mentioned while loop print the value of this variable it gets printed correctly. What is wrong with the mentioned code? I tried initializing all values in the array beforehand, but, of course, that was no help either.

fscanf reading into a double array strange values
===

The following code has the intent of reading doubles from a file and putting them into an array. Quite simple.

	double arr[100];
	int i = 0; 

	while(fscanf(fin, "%lf", &arr[i]) != EOF) 
		i++;

However when I print the array I get weird values. If I substitute the array variable with a regular double variable and inside the previously mentioned while loop print the value of this variable it gets printed correctly. What is wrong with the mentioned code? I tried initializing all values in the array beforehand, but, of course, that was no help either.
