感恩节快乐(如果适用)。我正在尝试创建一个将来可以使用的功能。该函数应该能够接受一个char数组并对其进行编码。(我还没有完成代码部分)
int codetut(char *codeit){
int x,y = 0;
char tmparry[strlen(codeit)];
while(codeit[x] != '\0'){
if((codeit[x] >= 'a' && codeit[x] <= 'z') || (codeit[x] >= 'A' && codeit[x] <= 'Z')){ //Set to look for capitals and commons
if((codeit[x] == 'a' || codeit[x] == 'e' || codeit[x] == 'i' || codeit[x] == 'o' || codeit[x] == 'u') && (codeit[x] == 'A' || codeit[x] == 'E' || codeit[x] == 'I' || codeit[x] == 'O' || codeit[x] == 'U')){ // set to look for vowels
tmparry[y] = codeit[x];
x++,y++;
}else{
x++,y;
}
}else{
tmparry[y] = codeit[x];
x++,y++;
}
}
printf("%s",tmparry);
return 0;
}
我在这里寻找如何同时验证小写字母和大写字母。不幸的是,我没有找到想要的东西。
问题:
只需一个请求,如果您知道有什么对我有帮助的帖子,请指向我。
首先将字符转换为较低的字符,然后进行比较。
tolower
是这样做的方法。参见例如c-将大小写混合的字符串转换为所有小写字母
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句