69,382
社区成员
发帖
与我相关
我的任务
分享
#include<stdio.h>
#include<stdlib.h>
int main()
{
char *ch="nii.txt";
FILE * fi=fopen(ch,"w");
if(fi==NULL)
return -1;
fputs("12345nihao67890qwertyu",fi);
int aa=fputc('X',fi);
fclose(fi);
putchar(aa);
fi=fopen(ch,"r");
if(fi==NULL)
return -1;
printf("%c\n",fgetc(fi));
printf("%c\n",getc(fi));
char * out;
fscanf(fi,"%s",out);
char cc;
while(sscanf(out,"%c",&cc)!=EOF)
{
printf("%c\n",cc);
out++;
}
fclose(fi);
fi=fopen(ch,"r");//跳到了这里 fscanf(fi,"%s",out);
printf("%s\n",out);
fclose(fi);
return 0; //调试发现运行到这里后有跳到上面的标注出}