Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
FILE *infile;
float skatertime[32][1500];
int i, a, b;
float left, right, add;
infile = fopen("speed", "r");
if (infile == NULL)
{
printf("speed not working\n");
exit(1);
}
for (i = 0; i < 12; i++)
{
fscanf(infile, "%f %f", &skatertime[a], &skatertime[b]);
printf("Left: %f Right %f\n", skatertime[a], skatertime[b]);
a++;
b++;
}
return 0;
}
i keep getting these errors
dsu@Ubuntu9:~/programs$ gcc todayfile1.c -o todayfile1
todayfile1.c: In function ‘main’:
todayfile1.c:21: warning: format ‘%f’ expects type ‘float *’, but argument 3 has type ‘float (*)[1500]’
todayfile1.c:21: warning: format ‘%f’ expects type ‘float *’, but argument 4 has type ‘float (*)[1500]’
todayfile1.c:22: warning: format ‘%f’ expects type ‘double’, but argument 2 has type ‘float *’
todayfile1.c:22: warning: format ‘%f’ expects type ‘double’, but argument 3 has type ‘float *’