Курсовая работа: Построитель вопросительных предложений
memset(res,0,20);
r=res;
if(*tmp==0)return 0;
while(!(islower(*tmp)||isupper(*tmp)))tmp++;
if(islower(*tmp)||isupper(*tmp))
while(islower(*tmp)||isupper(*tmp))*r++=*tmp++;
tmp++;
return 1;
}
int getqword(word *wrd){
FILE *f;
int res=0;
word tmp;
f=fopen("qwrds.dat","r");
while(fread(&tmp,sizeof(word),1,f)>0){
if((wrd->params[0]&tmp.params[0])&& \
(wrd->params[1]&tmp.params[5])&& \
(wrd->params[2]&tmp.params[5])&& \
(wrd->params[3]&tmp.params[5])&& \
(wrd->params[4]&tmp.params[5])&& \
(wrd->params[5]&tmp.params[5])){
strcpy(wrd->qwrd,tmp.qwrd);
res=1;
break;
}
}
fclose(f);
return res;
}