Skip to content

Commit 9a859a2

Browse files
Create abc.txt
1 parent 9408db3 commit 9a859a2

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

abc.txt

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
int main()
2+
{
3+
FILE *ft;
4+
char ch;
5+
ft=fopen("abc.txt","r+");
6+
if(ft==NULL)
7+
{
8+
printf("can not open target file\n");
9+
exit(1);
10+
}
11+
while(1)
12+
{
13+
ch=fgetc(ft);
14+
if(ch==EOF)
15+
{
16+
printf("done");
17+
break;
18+
}
19+
if(ch=='i')
20+
{
21+
fputc('a',ft);
22+
}
23+
}
24+
fclose(ft);
25+
return 0;
26+
}
27+
As one can see that I want

0 commit comments

Comments
 (0)