I am getting this error2:
1) error C2108: subscript is not of integral type
2) error C2102: '&' requires l-value
I tried replacing float with int and all works fine. Why do I get the problem with float?
#include <stdio.h>
#define N 15
main()
{
FILE *fdi;
fdi = fopen("input.txt", "r");
float MyArray[N][N];
float x, y;
for (x=0; x<N; x++)
for (y=0; y<N; y++)
fscanf(fdi,"%f", &MyArray[x][y]);
printf("%f", MyArray[3][2]);
return 0;
}
1) error C2108: subscript is not of integral type
2) error C2102: '&' requires l-value
I tried replacing float with int and all works fine. Why do I get the problem with float?
#include <stdio.h>
#define N 15
main()
{
FILE *fdi;
fdi = fopen("input.txt", "r");
float MyArray[N][N];
float x, y;
for (x=0; x<N; x++)
for (y=0; y<N; y++)
fscanf(fdi,"%f", &MyArray[x][y]);
printf("%f", MyArray[3][2]);
return 0;
}