解释一下这几行程序的意思

问题描述:

解释一下这几行程序的意思
void getkeymatrix(char (*p)[5],char *srckey)
{
int i = 0,j = 0;
char *q = srckey;
char temp[26];
memset(temp,0,26);
strupr(srckey);
while(*q = '\0')
{
if( isalpha(*q) = 0 && *q = 'Q')
{
if(strchr(temp,*q) == NULL)
{
temp[i++] = *q;
}
}
q++;
}
for(j = 'A'; j
1个回答 分类:综合 2014-11-10

问题解答:

我来补答
void getkeymatrix(char (*p)[5],char *srckey)
{
int i = 0,j = 0;
char *q = srckey;
char temp[26];
memset(temp,0,26);//初始化数组使之为空
strupr(srckey);//是字母的话,所有字母转换成大写的
while(*q != '\0')
{
if( isalpha(*q) != 0 && *q != 'Q')//字符串里如果是字母的话(除字母Q),执行if语句里面的语句
{
if(strchr(temp,*q) == NULL)//如果*q所对应的字母在temp数组中没有的话就把该字母加到数组里
{
temp[i++] = *q;
}
}
q++;//指针往后移动
}//整个循环后就会把strckey里的字母(字母不为Q)存到数组里,且数组内没有重复的字母
for(j = 'A'; j
 
 
展开全文阅读
剩余:2000