找出一个字符串中所有的元音字母
2017-11-22 21:55
330 查看
int main() { char sentence[] = "Wangye is a handsome boy!"; char Vowels[] = "aeiou"; char* pch = NULL; printf("Vowels in '%s': ", sentence); pch = strpbrk(sentence, Vowels);//这里用了strpbrk函数 while (pch != NULL) { printf("%c ", *pch); pch = strpbrk(pch + 1, Vowels); } printf("\n"); system("pause"); return 0; }
strpbrk
函数原型:char* strpbrk( const char*, const char* );
注释:Returns a pointer to the first occurrence in str1 of any of the characters that are part of str2, or a null pointer if there are no matches.
返回第一个字符串中第一个出现在第二个字符串中的字符的地址
相关文章推荐
- ACM273 给你一个乱序的字符串,里面包含有小写字母(a--z)以及一些特殊符号,请你找出所给字符串里面所有的小写字母的个数, 拿这个数对26取余,输出取余后的数字在子母表中对应的小写字母(0对应z
- 给定一个数字字符串,返回数字可能表示的所有可能的字母组合。数字与字母的对应关系和手机按键对应。
- 找出自己应用程序里面所有的中文字符串,替换为字符串变量,并将所有字符串放到一个文本文件中。
- 一个一万字长的连续字符串,找出其所有子串,并统计子串的出现次数
- 将一个字符串的元音字母复制到另一个字符串并排序
- 给定一个只包含小写字母的字符串,删除重复的字母,每个字母只出现一次。在所有结果中,输出字典顺序最小的。
- 给定一个数字字符串,返回数字可能表示的所有可能的字母组合。数字与字母的对应关系和手机按键对应
- 谷歌:有一个由大小写组成的字符串,将其中的所有小写字母排在大写字母的前面
- 17、有一个由大小写组成的字符串,现在需要对他进行修改, 将其中的所有小写字母排在答谢字母的前面(大写或小写字母之间不要求保持原来次序)
- 将一个字符串元音字母复制到另一个字符串,并排序
- 请编写一个函数fun(char *s),其功能是:将s所指字符串中所有的字母改写成该字母的下一个字母,若是z字母,则改为a字母,大、小写保持不变。
- Java找出一个字符串中重复最多字母的次数
- C语言进阶之路-----用函数将一个字符串中的元音字母复制到另一个字符串中
- 给出一个名字,该名字有26个字符串组成,定义这个字符串的“漂亮度”是其所有字母“漂亮度”的总和。
- Quzh[python]统计元音字母——输入一个字符串,统计处其中元音字母的数量。
- 习题 7.7 写一个函数,将一个字符串中的元音字母复制到另一字符串,然后输出。
- C语言 字符串 编一个程序,输入一个字符串,将组成字符串的所有非英文字母的字符删除后输出。
- 8.7 写一函数,将一个字符串中的元音字母复制到另一字符串,然后输出。
- 从键盘输入一个由字母构成的字符串(不大于30个字符),要求从该串中取出3个不重复的字符,求所有不同的取法。如果字符串中没有取到3个不同的字符,则提示没有结果。对取出的字符要求按字母升序排列成串,对于不
- 给出一个名字,该名字有26个字符串组成,定义这个字符串的“漂亮度”是其所有字母“漂亮度”的总和。