c 字符串提取Mystrstr
来源:互联网 发布:海关大数据数据挖掘 编辑:程序博客网 时间:2024/06/06 02:13
#include<iostream>
using namespace std;
int Mystrstr(char *srcstr,char *deststr);
int main(void){
char *srcstr = "chinese people!";
char *deststr = "people";
cout<<"The deststr of position in srcstr is:"<<Mystrstr(srcstr,deststr)<<endl;
return 0;
}
int Mystrstr(char *srcstr,char *deststr)
{
int k = 0;
static int retval;
for(retval = 0;srcstr[retval] != '\0';retval++){
if(deststr[0] == srcstr[retval]){
while(deststr[k]!='\0' && srcstr[retval+k]!='\0'){
k++;
if(deststr[k]!= srcstr[k+retval]){
break;
}
}
}
if(deststr[k] == '\0')
{
return retval;
}
}
return -1;
}
- c 字符串提取Mystrstr
- myStrstr
- c语言字符串的提取
- c提取字符串中的数字
- 【C语言】 提取子字符串
- 【C#】[字符串]字符串提取(获取两个字符串中间的字符串)
- C语言 从字符串中提取数字
- c实现字符串拆分与提取
- 联想功能字符串的提取(c)
- 提取字符串
- 字符串提取
- 提取字符串
- 提取字符串
- 字符串提取
- 提取字符串中子串所在的位置-Objective-c(字符串提取关键词位置)
- 算法练习Mystrstr
- 【C语言】从字符串中简单提取数值
- 字符串中提取数字的实现(c++)
- arcsde service(esri_sde)服务启动后又停止
- python struct模块
- socket基础
- WAN监控:是否应该外包?
- java视频---集合类
- c 字符串提取Mystrstr
- Apache Commons-logging+log4j配置
- UIWebView 调用本地 html 和 javascript 的教程
- OpenCV直方图均衡
- 简单说说MYSQL的触发器(例子包括了存储过程)
- socket服务器端
- centos6.0本地的yum源来装development tools
- JS正则表达式大全
- Error importing repomd.xml for updates: Damaged repomd.xml file 解决方法