实现strstr函数
来源:互联网 发布:什么叫做js事件event 编辑:程序博客网 时间:2024/05/16 17:20
新手自己实现的strstr函数,,不足之处请指教
#include<stdio.h>char *mystrstr(char *str1, char *str2){ while (*str1 != '\0') { char *nowstr1 = str1; char *nowstr2 = str2; while (*nowstr1 == *nowstr2) { nowstr1++; nowstr2++; if (*nowstr2 == '\0') { return str1; } } str1++; } return NULL;}void main(){ char str1[100]="wohenaini"; char str2[100]="ai"; char *findd = mystrstr(str1, str2); if (findd == NULL) { printf("没有找到字符串\n"); } else { printf("找到!!\n"); printf("%s\n", findd); //返回字符串 }}
0 0
- 实现strstr函数
- strstr()函数原型实现
- strstr函数实现
- strstr函数实现
- strstr函数实现
- 实现strstr()函数
- strstr函数实现
- 实现strstr 函数
- C++ - 实现strstr函数
- 实现strstr函数
- 实现strstr函数
- strstr函数实现
- strstr函数的实现
- strchr(),strstr()函数实现
- strstr函数实现
- strstr 函数的 实现
- 实现strstr函数
- 自己实现strstr函数
- MyEclipse中配置struts.xml自动提示的方法
- iPhone开发常问的十个问题(2012年3月版)
- Spring并发访问的线程安全性问题
- tableview2222
- 解决Activity启动黑屏及设置android:windowIsTranslucent不兼容activity切换动画问题
- 实现strstr函数
- 怎么看变量声明
- hznu 1628: 旅行家的预算(贪心,分类)
- Android 更新SDK 出现问题:Download interrupted: URL not
- mybatis动态SQL语句(转)
- LCD设备驱动分析
- VMware Workstation环境下的CentOS网络连接设置
- 宏函数定义时需要注意的一些细节
- 关于Struts-JSON的提高开发效率