|
经实测,能
至少本人测试过文件指针
[code=Bash width=740px]#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
main()
{ FILE *f;
f=fopen("1.txt","w+");
char a[32766];
char b[32766];
printf("请输入一个字符串\n");
scanf("%s",a);
printf("正在写入");
Sleep(500);
printf(".");
Sleep(500);
printf(".");
Sleep(500);
printf(".");
system("cls");
printf("输入字符串完成!\n输出文件中的字符串:\n");
fputs(a,f);
rewind(f);
fgets(b,32767,f);
printf("%s\n",b);
system("pause");
return 0;
}
[/code] |
|