I can't get the program to read the data file. I am supposed to output the five values in the data file five per line using pointers. When I debug it is not reading any of the values in the data file.
Any tips? Thanks!
Here's my program:


#include <stdio.h>
FILE *myinptr;
void fiveperline(double *);
int main()
{
int i;
double x[10];
myinptr=fopen("data.txt", "r");
for (i=0;i<10;i++)
fscanf(myinptr,"%.2lf", &x[i]);
fclose(myinptr);
fiveperline(x);
return 0;
}


void fiveperline(double *x)
{
int i;
for (i=0;i<10;i++){
printf("%.2f\t", x[i]);
if((i+1)%5==0)
printf("\n");
}

}

Data File (data.txt)
8.50
8.60
8.90
7.95
8.89
6.95
7.25
8.76
9.45
8.25