В вашем коде много ошибок.Вы, вероятно, хотите это:
#include <stdio.h>
int main(void)
{
FILE *ifile;
float num;
float numbers[8001]; // you just need an array of float, no pointers needed
int i = 0;
ifile = fopen("lotsOfNumbers.txt", "r");
if (ifile == NULL) {
printf("File not found!! Exiting.\n");
}
else {
while (fscanf(ifile, "%f ", &num) != EOF) { // &num instead of num
printf("I read %f from the file.\n", num); // use %f for printing a float, not %d
numbers[i] = num;
if (i < 8001) { // 8001 instead of 8801
i++; // using a constant or a #define avoids this kind of errors
}
else
return 0;
}
fclose(ifile); // close file only if it has been opened sucessfully
}
// fclose(ifile); // that was the wrong place for fclose
}
Пояснения в комментариях.