下面的代碼可能會出錯,它永遠不會打開文件。我也嘗試過使用絕對文件路徑,但這並沒有幫助我,我知道文件在那裏。從C中的文本文件讀取空格分隔的浮點值C
FILE *myfile;
myfile= fopen("IN.txt",r);
if (myfile != NULL)
{
while (fscanf(myfile,"%lf",&test) !=eof)
{
printf("%f",test);
printf("\n");
}
}
fclose(myfile);
EOF應該是EOF – 2013-03-14 07:17:45