找合法针
来源:互联网 发布:python自动化测试视频 编辑:程序博客网 时间:2024/04/27 13:48
asdheadhauboisoktailgdg找这个的合法针,需要我们先扫描到我们需要的head(这个是针头),tail(这个是针尾)下面的是代码
#include <stdio.h>#include <string.h>// 在字符串str中寻找字符串sub,如果找到返回从sub开始的字符串char *findStr(char* str, char *sub){ char *p = NULL; int len = strlen(sub); // 算字串的长度 while(*str) { if (strncmp(str, sub, len) == 0) { p = str; break; } str++; } return p;}// 找合法帧void findFrame(char *str, char *head, char *tail){ char *phead = findStr(str, head); // 找帧头的位置 char *ptail = findStr(str, tail); // 找帧尾的位置 if (phead != NULL && ptail != NULL) { ptail += strlen(tail); *ptail = '\0'; printf ("%s\n", phead); }}int main(){ char str[] = "asdheadhauboisoktailgdg"; findFrame(str, "head", "tail"); return 0;}
阅读全文
0 0
- 找合法针
- 找合法帧 QAQ
- 找合法帧
- 找合法帧
- 找合法帧
- 找合法帧
- 强化练习5:找合法帧
- 找
- 找
- 找
- 合法地址
- 合法字符串
- 合法字符串
- 合法IP
- 合法IP
- 合法IP
- 合法序列
- 合法字符串
- 浅谈对Vue.js的MVVM的理解
- Android
- HTML5之XMLHttpRequest Level 2 API跨源运用案例
- 所谓的创业,认真的思考
- 插入排序及2种优化
- 找合法针
- 2017_7_19图片整合、活动门、网页制作心得
- 查找一个字符串中第一个只出现两次的字符
- 【Java虚拟机】Java内存区域
- Bubble sort | Iterative & Recursive
- Object类
- Redis--集群
- hdu_1251 统计难题 trie模版
- base64 加密技术的解析