#include <stdio.h>
#include <stdlib.h>
int main(void)
{
test();
system("PAUSE");
return 0;
}
int test(void)
{
int i;
char fileString[15];
FILE *file = fopen("D:\\test.txt", "a+");
fprintf(file, "%s", "Hello");
fclose(file);
FILE *file_1 = fopen("D:\\test.txt", "r");
for (i = 0; !feof(file_1); i++)
{
fileString[i] = fgetc(file_1);
}
fclose(file_1);
printf("%s", fileString);
return 0;
}
运行结果输出的除了Hello以外还有一个空格和很多的‘烫’怎么解决
![](http://imgsrc.baidu.com/forum/w%3D580/sign=b3e2f7aa9425bc312b5d01906edf8de7/c5678794a4c27d1e4c0c19a016d5ad6eddc43807.jpg)