strstr函数的用法

【FEOM MSDN &&百科】

原型:char *strstr(const char *str1,const char *str2);

#include<string.h>

找出str2字符串在str1字符串中第一次出现的位置(不包括str2的串结束符)。返回该位置的指针,如果找不到,返回空指针。

int main()
{
    char *s="Golden"
    char *l="go";
    char *p=strstr(s,l);
}


posted @ 2017-10-22 14:37  Bryce1010  阅读(201)  评论(0编辑  收藏  举报