I have the following code:
FILE *fp;
double Data[9][7];
int i=0,k;
fp = fopen ( "dstest 2.mod", "r" ) ;
fscanf(fp, "%E %E %E %E %E %E %E*[ ]",
&Data[i][0],
&Data[i][1],
&Data[i][2],
&Data[i][3],
&Data[i][4],
&Data[i][5],
&Data[i][6] );
But whenever I run it I get the following warnings:
Read.c:12: warning: format ‘%E’ expects type ‘float *’, but argument 3 has type ‘double *’
And it goes for all the arguments (Data[i][j]). I have no idea what’s wrong. The problem goes away when I use float Data instead of double data. But that will not fit in my requirements.
man scanf says that you need the
lmodifier character to read a double:and so on.