strstr函数
来源:互联网 发布:太仓港数据信息中心 编辑:程序博客网 时间:2024/05/16 19:52
////返回包括子串的整个字符串
#include<string.h>
#include<stdio.h>
#include<iostream>
using namespace std;
const char* strstr1(const char *s,const char* str)
{
for(int i =0;s[i]!='/0';i++)
{
int j = 0;
if(s[i]==str[j])
{
while(s[i++]==str[j++])
{ //字串到头了
if((str[j]=='/0'))
return &s[i-j];
}
}
}
return 0;
}
void main()
{
char * s="012345678901234567890123456789";
printf("s = %s/n",s);
char str[10]={0};
cin>>str;
cout<<strstr1(s,str)<<endl;
//p= strstr(s,"901"); ////返回包括字串后面的整个字符串
//printf("%s/n",p);
}
- strstr函数
- strstr()函数
- strstr() 函数
- strstr函数
- strstr函数
- strstr函数
- strstr 函数
- strstr函数
- strstr函数
- strstr() 函数
- strstr函数
- strstr函数
- strstr 函数
- strstr函数
- strstr函数
- 函数strstr()
- strstr函数
- strstr函数
- 读《精通Struts:基于MVC的JavaWeb设计与开发》
- [转]浅析ethx网卡控制函数ioctl实现具体流程
- 用javascript实现GridView行背景色交替鼠标划过行变色点击行变色选中
- linux安装全过程
- 自写保存字符串或文件为asp.net缓存的类
- strstr函数
- 如何使用TabControl控件?
- 正则表达式高级技巧背后的关键概念
- 下面是如何用佑手服装CAD打版、放码系统来完成一套裤子的样版:
- 从今天起,写写我关心的技术
- Linux 网络接口管理相关命令介绍
- 2009 Winter new package Qiangxian Kan LV bags
- java实现对象池
- H3C SNMP配置