c语言strchr函数

来源:互联网 发布:org.apache.http post 编辑:程序博客网 时间:2024/05/13 12:38

转自:http://www.kuqin.com/clib/string/strchr.html

strchr

  原型:extern char *strchr(char *s,char c);          用法:#include <string.h>    功能:查找字符串s中首次出现字符c的位置    说明:返回首次出现c的位置的指针,如果s中不存在c则返回NULL。    举例:      // strchr.c            #include <syslib.h>      #include <string.h>      main()      {        char *s="Golden Global View";        char *p;                clrscr();                strchr(s,'V');        if(p)          printf("%s",p);        else          printf("Not Found!");        getchar();        return 0;      }
原创粉丝点击