Implement substring in C
来源:互联网 发布:淘宝主营在哪里看 编辑:程序博客网 时间:2024/06/05 05:28
#include<stdlib.h>char a[6] = {'a','b','c','d','e','f'};char b[3] = {'c','d','e'};int subString(char* a, int aLen, char* b, int bLen){int i = 0;int j = 0;for(; i < aLen - bLen; i++){for(; j < bLen; j++){if(a[i+j] != b[j]){break;}if(j == bLen - 1){return i;} }}return -1;}int main(){int result = subString(a,6,b,3);printf("%d",result);}
- Implement substring in C
- Substring in c programming
- [LeetCode] Implement strstr() to Find a Substring in a String
- How to implement Polymorphism in C
- a double-end queue's implement in c under linux
- a round-robin queue implement in c under linux
- A way to implement a general purpose LinkedList in C
- Design a HashMap class in C++. Implement put, get methods.
- Implement HashMap in Java
- implement ArrayList in java
- [iOS开发站在巨人肩膀上]之How to implement Queue in Objective-C
- [iOS开发站在巨人肩膀上]之How to implement a stack in Objective-C
- How to implement the similar mechanism with Java final in c++?
- Implement Singeton Pattern in C#
- Implement editable Cells in table
- Implement the Singleton In AS3
- A Markdown implement in browser
- implement, extends, super in Java
- live555 Streaming Media 分析与开发 .
- 深度看MVC
- 【Cocos2d-X开发学习笔记】第21期:动画类(CCAnimate)的使用
- Java线程的挂起与唤醒
- 欧拉回路+图的连通性
- Implement substring in C
- 编程珠玑 用后缀数组求字符串的最大重复子串
- 从归并排序到数列的逆序数对(微软笔试题)
- 理解 Proc 文件系统
- linux下vim中文乱码的解决方法
- Uart_Printf()函数实现
- ASP.NET MVC 的URL路由介绍
- HDU 2647 Reward 反向拓补排序
- 【黑马程序员】技术加强之代理与动态加载类