strstr( )函数用法——来源于网络

来源:互联网 发布:软件开发经历 英文 编辑:程序博客网 时间:2024/06/08 01:57

函数名: strstr功 能: 

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

用 法: 

char *strstr(char *str1, char *str2);

程序例:

#include 

#include

int main(void)

{ char *str1 = "Borland: International", *str2 = ":", *ptr; 

 ptr = strstr(str1, str2); 

 ptr=ptr+1; 

 printf("The substring is: %s\n", ptr); return 0;

}


打印结果:International