Chinaunix首页 | 论坛 | 博客
  • 博客访问: 450751
  • 博文数量: 179
  • 博客积分: 3236
  • 博客等级: 中校
  • 技术积分: 1860
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-25 19:13
文章分类

全部博文(179)

文章存档

2011年(34)

2008年(8)

2007年(27)

2006年(110)

分类:

2006-10-26 10:13:43


strstr函数介绍
 
reway-mw:/#vi test.c
 
#include
#include
#include
main()
{
    char *s="hello wang";
    char *l="ang";
    char *p;
    p=strstr(s,l);
    if(p)
    {
       printf("%s\n",p);
    }
    else
    {
       printf("Not found\n");
    }
}
 
reway-mw:/#gcc -o test test.c
 
reway-mw:/#./test
 
reway-mw:/#ang
 
strstr(char *pSrc,char *pDst)
 
该函数在pSrc字串中找pDst字串,返回pDst在pSrc中的指针位置.

阅读(2299) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~