小型的文本编辑器(使用能通配符*和?)
小型的文本编辑器(使用能通配符*和?)使用时确保你要处理的文件在当前工作目录下。
#include
#include
#include
#include
typedef strUCt {
char Word[20];
int length;
}wordtype;
wordtype seekword; /*seekword用来放要查找的词*/
wordtype save; /*save用来临时成放从文件中读出的词*/
int check(char ch) /*检查是否是合法的字符*/
{
if(ch<='9'&&ch>='0'ch<='z'&&ch>='a'ch<='Z'&&ch>='A')
return 1;
else
return 0;
}
void length() /*计算seekword 和save中的word[]的长度*/
{
int i;
seekword.length=0;
save.length=0;
for(i=0;seekword.word[i]!='
- 上一篇:行==列==对角线 ◎ 魔幻矩阵
- 下一篇:C++中用赋值形式op=取代单独形式op