下面的代码可能会出错,它永远不会打开文件。我也尝试过使用绝对文件路径,但这并没有帮助我,我知道文件在那里。从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