strstr函数(Brutr-Force算法)
来源:互联网 发布:星际淘宝系统 编辑:程序博客网 时间:2024/06/15 13:50
Brutr-Force算法:当比较字串失败后,返回到初始比较的下一字节
int strstr1(const char *str, const char *substr)
{
assert(NULL != str || NULL != substr);
int index = 0;
int temp =0;
int subIndex = 0;
while(*str)
{
if(*str == *substr)
{
temp = index;
subIndex = 0;
while((*substr != NULL) && (*str != NULL) && (*str == *substr))
{
index++;
subIndex++;
substr++;
str++;
}
if(*str - *substr == 0)
{
break;
}
substr -= subIndex;
str -= index-temp;
index = temp;
temp = -1;
}
index++;
str++;
}
return temp;
}
- strstr函数(Brutr-Force算法)
- strstr函数(KMP算法)
- KMP算法实现strstr()函数
- strstr函数与KMP算法比较
- strstr函数
- strstr()函数
- strstr() 函数
- strstr函数
- strstr函数
- strstr函数
- strstr 函数
- strstr函数
- strstr函数
- strstr() 函数
- strstr函数
- strstr函数
- strstr 函数
- strstr函数
- 外企也官僚
- Sys.WebForms.PageRequestManagerParserErrorException 错误
- CMS 订单管理系统
- QT产生随机数和定时器
- 日期排序 deque
- strstr函数(Brutr-Force算法)
- VxWorks 引导程序(BIOS/BootLoader/Bootrom)
- 时间管理的七条致命的禁忌
- 关于Panel中选择子控件时使其滚动条焦点失效的处理
- VxWorks BSP和启动过程简介
- 算法实验题3.2 调度问题
- 深入理解控制台程序
- VxWork BSP 和启动过程
- BSP配置文件及生成下载