c語言刪除單詞
發布時間: 2023-07-27 20:25:11
1. c語言執行命令快捷鍵是什麼
1、重置配置的方法:
2. 求助C語言 刪除文本文件內的指定字元串
#include<stdio.h>
#include<string.h>
intmain(){
charinfilename[]="indata.txt";
charoutfilename[]="outdata.txt";
charstr[81];//假定每個文件名不超過80個字元
chars[81];
FILE*fin,*fout;
fin=fopen(infilename,"rt");
fout=fopen(outfilename,"wt");
if(fin==NULL||fout==NULL){
printf("不能打開文件。 ");
return1;
}
printf("待刪除的字元串:");
gets(str);
while(fgets(s,81,fin))
if(strcmp(str,s))fprintf(fout,"%s",s);
fclose(fin);
fclose(fout);
return0;
}
熱點內容