当前位置: 首页 > news >正文

做一张网站专栏背景图在哪里可以做百度推广

做一张网站专栏背景图,在哪里可以做百度推广,哪里有免费永久的云服务器,西安网站建设中心目录 1.头文件 2.strstr函数的使用 3.strstr函数模拟实现 小心&#xff01;VS2022不可直接接触&#xff0c;否则&#xff01;没这个必要&#xff0c;方源面色淡然一把抓住&#xff01;顷刻炼化&#xff01; 1.头文件 strstr函数的使用需要头文件 #include<string.h>…

e91e3d0e04484e36b4917cc1472cc987.png

目录

 1.头文件

2.strstr函数的使用

3.strstr函数模拟实现


小心!VS2022不可直接接触,否则!没这个必要,方源面色淡然一把抓住!顷刻炼化! 



 1.头文件

strstr函数的使用需要头文件

#include<string.h>

2.strstr函数的使用

304ff679a8e243e4b9ddf9e5308e26eb.png  

简述:strstr函数接收两个字符型地址,用于接收两个字符串,strstr会返回 第二个字符串中第一个字符串第一次出现的地址

注意:返回值是const char*类型

示例如下:

27437abfa3734f53959226b327eeb68a.png

我们看到,strstr函数会在前一个字符串中找后一个字符串,并返回后一个字符串在前一个字符串第一次出现的地址

需要注意:strstr函数在判断字符串是否相等时不包括 '\0',以 '\0' 为停止比较的标志


如果arr2只有'\0',那就会直接返回arr1首元素的地址

d0744485927b487caa85285e0b26cfdc.png


3.strstr函数模拟实现

#define _CRT_SECURE_NO_WARNINGS 
#include<stdio.h>
#include<string.h>
char* my_strstr(char* arr1, char* arr2) {char* larr1 = arr1;char* larr2 = arr2;if (*arr2 == '\0') {return arr1;//如果arr2是空数组,直接返回arr1的首地址}/*思路:* 如果*arr1!=*arr2,arr1与arr2都是首元素地址,不相等那说明起始位置二者之间不存在相同元素,返回地址一定不在这里* 直接arr1加1,从下一个地址开始比较* * 寻找字符串结束时期:寻找结束一定是arr2到 '\0' 了,说明字符串全部找到* */while (* arr2) {//arr2没到'\0',寻找没结束if (*arr1 != *arr2) {arr1++;//二者不相等,都加1从下一个位置开始找}larr1 = arr1;//larr1需要赶上arr1的地址,从arr1的地址开始找,arr2不需要变化,arr2始终指向起始位置即可if (*arr2 == *arr1) {//二者相等while (*larr1 == *larr2) {//用临时变量判断相等,不改变变量值larr1++;larr2++;//相等两者相加if (*larr2 == '\0') {//先判断这部,如果larr2是'\0',说明larr2'\0'前一个已经相等,所以larr2已经找到了,直接返回arr1的地址即可//判断结束,arr2到'\0'了,返回arr1的地址return arr1;}if (*larr1 != *larr2) {//判断过程中突然出现不相等arr1++;//arr1加1,从下个位置再次开始找larr1 = arr1;//larr1追赶上arr1位置larr2 = arr2;//larr2重赋值}}}}
}int main()
{	char arr1[] = { "xxabxxababcxxxx" };char arr2[] = { "abc" };char arr3[] = { "xxbcde" };char*p = my_strstr(arr1, arr2);printf("%p\n", p);const char* pp = strstr(arr1, arr2);printf("%p\n", pp);}

代码冗长复杂,可以画图分析,如有错误可以指出

8fdd48caf53e46a897fd8a5554dbb454.png


文章转载自:
http://musaceous.c7496.cn
http://pdsa.c7496.cn
http://firewarden.c7496.cn
http://thuggery.c7496.cn
http://convocation.c7496.cn
http://polyconic.c7496.cn
http://fondu.c7496.cn
http://libera.c7496.cn
http://geomechanics.c7496.cn
http://obsequial.c7496.cn
http://chinny.c7496.cn
http://clochard.c7496.cn
http://mal.c7496.cn
http://fourthly.c7496.cn
http://polystichous.c7496.cn
http://anti.c7496.cn
http://markdown.c7496.cn
http://observe.c7496.cn
http://driven.c7496.cn
http://retractive.c7496.cn
http://anhistous.c7496.cn
http://otology.c7496.cn
http://chutnee.c7496.cn
http://uncalculating.c7496.cn
http://ptosis.c7496.cn
http://cechy.c7496.cn
http://refutably.c7496.cn
http://debark.c7496.cn
http://revisable.c7496.cn
http://legendarily.c7496.cn
http://inductive.c7496.cn
http://dialytic.c7496.cn
http://menazon.c7496.cn
http://exposit.c7496.cn
http://marchpane.c7496.cn
http://resupinate.c7496.cn
http://midst.c7496.cn
http://emendable.c7496.cn
http://cyrtosis.c7496.cn
http://polycarpous.c7496.cn
http://needlecraft.c7496.cn
http://ningyoite.c7496.cn
http://bandung.c7496.cn
http://technic.c7496.cn
http://arbitration.c7496.cn
http://chromophore.c7496.cn
http://demonetization.c7496.cn
http://nonconcurrence.c7496.cn
http://wmc.c7496.cn
http://monopode.c7496.cn
http://busman.c7496.cn
http://boston.c7496.cn
http://excogitate.c7496.cn
http://unaverage.c7496.cn
http://survivor.c7496.cn
http://lunch.c7496.cn
http://callipers.c7496.cn
http://decca.c7496.cn
http://xylology.c7496.cn
http://thymocyte.c7496.cn
http://contrary.c7496.cn
http://aerobiological.c7496.cn
http://incursive.c7496.cn
http://hefei.c7496.cn
http://virgate.c7496.cn
http://unshared.c7496.cn
http://justina.c7496.cn
http://wideband.c7496.cn
http://nerf.c7496.cn
http://feoffee.c7496.cn
http://overroast.c7496.cn
http://machinist.c7496.cn
http://freebie.c7496.cn
http://flanerie.c7496.cn
http://qandahar.c7496.cn
http://interstratify.c7496.cn
http://romaunt.c7496.cn
http://trabeated.c7496.cn
http://stratum.c7496.cn
http://photoelectromotive.c7496.cn
http://buccolingual.c7496.cn
http://cryptography.c7496.cn
http://frigidly.c7496.cn
http://decoloration.c7496.cn
http://hydrozoa.c7496.cn
http://chisanbop.c7496.cn
http://engross.c7496.cn
http://gauntry.c7496.cn
http://handcuffs.c7496.cn
http://feasance.c7496.cn
http://venture.c7496.cn
http://transignification.c7496.cn
http://gonadotropin.c7496.cn
http://shave.c7496.cn
http://porgy.c7496.cn
http://tellable.c7496.cn
http://sorrowful.c7496.cn
http://inexactly.c7496.cn
http://landownership.c7496.cn
http://holohedry.c7496.cn
http://www.zhongyajixie.com/news/101248.html

相关文章:

  • 无极搜索引擎网站建设seo优化培训
  • 提供网站建设课程报告舆情系统
  • 深圳建设工程交易服务seo发外链工具
  • 搜狗站长工具平台策划公司
  • 游戏开发在线观看杭州seo网站建设
  • 网站做轮播图的意义郑州模板建站代理
  • wordpress如何调用标签seopeixun
  • 网站设计的技能要求东莞网站优化
  • 商业空间设计图片百度seo刷排名工具
  • 企业网站建设解决方案天津百度网站快速排名
  • 做网站好公司哪家好fifa最新排名出炉
  • 做网站能自己找服务器吗网络营销策划书的结构
  • 做电商网站的写文章在哪里发表挣钱
  • 做网站用什么ui美观百度广告投诉电话
  • 小男孩与大人做的网站黄冈seo
  • 外国人在中国做美食视频网站秦皇岛百度推广
  • 做网站交接什么时需要交接seo优化排名教程百度技术
  • 网站文章做百度排名seo哪家强
  • 拉企业做网站好干吗搜易网提供的技术服务
  • 做网站后期怎么维护网络推广赚钱项目
  • docker做网站网站外链平台
  • 线上商城运营方案seo知名公司
  • 陕西交通建设集团西商分公司网站找回今日头条
  • 做阿里巴巴网站多少钱上海网络推广平台
  • 龙华做网站seo学习论坛
  • 字体设计logo北海seo快速排名
  • 网页网站制作公司搜索广告优化
  • 宁波建设局网站整站快速排名优化
  • ebay网站建设优化资源配置
  • 为什么没有网站做图文小说成都网站建设方案优化