字符串函数的简单操作

如何在很多字符串中找到确定的字符

如果是找第二个特定字符呢。

 

 

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
    char a[]="Hello";
    char *p=strchr(a,'l');
    printf("%s\n",p);
    char *q=strchr(p+1,'l');  //从第p+1个字符再依次向下寻找l。
    printf("%s\n",q);
 return 0;
}

posted on 2017-02-13 15:19  hanlulu  阅读(88)  评论(0编辑  收藏  举报