文件读取问题
我把-128 到 127 之间的数读入out.txt ,又把数据从 out.txt 写入屏幕可是,屏幕上只显示到25就没有了 为什么??
源代码:
#include <stdio.h>
int main()
{
FILE * out = fopen("data.txt","w");
if (out == NULL)
return 0;
for (int i = -128; i <= 127; ++i)
fputc(i,out);
fclose(out);
out = fopen("data.txt","r");
if (out == NULL)
return 0;
int c = fgetc(out);
while (!feof(out))
{
printf("%c ",c);
c = fgetc(out);
}
return 0;
}