在串中查找指定字符串的第一次出现

函数名:strstr

功能:在串中查找指定字符串的第一次出现

用法:char *strstr(char *str1,char *str2);

实例:

#include<stdio.h>
#include<string.h>
int main(){
 char *s="0123456";
 char *p;
 p=strstr(s,"123");
 printf("%s\n",p);
 return 0;
}

猜你喜欢

转载自blog.csdn.net/wy15036307139/article/details/73436726