
查找字符
doudouwa1234
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【C语言】自己编写程序实现strrchr函数,即在给定字符串中找特定的字符并返回最后出现的位置
//自己编写程序实现strrchr函数,即在给定字符串中找特定的字符并返回最后出现的位置 #include #include char * my_strrchr(char const *str,int ch) { int count=0; while(*str!='\0') { count++; str++; } str--; while(count) { if(*s原创 2015-04-10 16:12:15 · 5970 阅读 · 2 评论 -
【C语言】自己编写程序实现strchr函数。即在给定字符串中找特定的字符并返回该处指针。
//自己编写程序实现strchr函数。即在给定字符串中找特定的字符并返回该处指针。 #include char * my_strchr(char const *str,int ch) { while(*str!='\0') { if(*str!=ch) str++; else return str; } printf("未找到该字符\n"); return 0;原创 2015-04-10 15:25:05 · 5172 阅读 · 0 评论