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

黔东南网站建设市场营销四大分析方法

黔东南网站建设,市场营销四大分析方法,在线平台,南京百度推广👦个人主页:Weraphael ✍🏻作者简介:目前是C语言学习者 ✈️专栏:C语言航路 🐋 希望大家多多支持,咱一起进步!😁 如果文章对你有帮助的话 欢迎 评论💬 点赞&a…

在这里插入图片描述

👦个人主页:@Weraphael
✍🏻作者简介:目前是C语言学习者
✈️专栏:C语言航路
🐋 希望大家多多支持,咱一起进步!😁
如果文章对你有帮助的话
欢迎 评论💬 点赞👍🏻 收藏 📂 加关注


前言

以下函数的查阅资料都在cplusplus网站

目录

  • 前言
  • 一、memcpy
      • (1)memcpy函数介绍
      • (2)memcpy函数用法
      • (3)memcpy函数模拟实现
      • (4)memcpy函数注意事项
  • 二、memmove
      • (1)memmove函数介绍
      • (2)memmove函数用法
      • (3)memmove函数模拟实现
  • 三、memcmp
      • (1)memcpy函数介绍
      • (2)memcpy函数用法
  • 四、memset函数

一、memcpy

(1)memcpy函数介绍

在这里插入图片描述

  • 功能:内存拷贝

(2)memcpy函数用法

memcpy的意义和strcpy、strncpy是一样的。
不同的是:strcpy和strncpy只能拷贝字符串,而memcpy既能拷贝字符串,也能拷贝整型等等

【拷贝整型】
在这里插入图片描述

【拷贝字符串】
在这里插入图片描述

(3)memcpy函数模拟实现

在这里插入图片描述

几个问题

  1. 函数返回类型为void*,是因为memcpy需要返回目标空间的起始地址
  2. destsrc的类型都为void*,是因为memcpy可以拷贝任意类型,而void*恰好可以结束任意类型的地址(指针)。这一块可参考qsort的模拟实现 点击跳转
  3. 由于类型不确定,所以只能一个字节一个字节交换内容,这一块同样参考qsort的模拟实现

(4)memcpy函数注意事项

  • 要保证目标空间足够大
  • 函数在遇到‘\0’的时候不会停下来
  • 如果sourcedestination有任何重叠,复制的结果是未定义
    在这里插入图片描述
    所以,如果想要重叠拷贝,需要用memmove(下面会介绍)

二、memmove

(1)memmove函数介绍

在这里插入图片描述

功能:移动内存块

(2)memmove函数用法

用法其实和memcpy一样,能移动字符、整型等类型

在这里插入图片描述

(3)memmove函数模拟实现

memmove需要分三种情况讨论

当source在前,destination在后时

在这里插入图片描述

最好的办法就是从destination的4开始往前拷贝,这样就不会导致复制的结果是未定义

在这里插入图片描述

当source在后,destination在前时
在这里插入图片描述
最好的办法就是从destination的9开始往后拷贝
在这里插入图片描述
当source和destination未重叠时
在这里插入图片描述
既可以从前开始拷贝,也能从后开始拷贝


【代码实现】

#include <stdio.h>
#include <string.h>
void* my_memmove(void* dest, void* src, size_t num)
{void* res = dest;if (dest < src){//从前向后拷贝(和memcpy一模一样)while (num--){*(char*)dest = *(char*)src;dest = (char*)dest + 1;src = (char*)src + 1;}}else{//从后向前拷贝while (num--){*((char*)dest + num) = *((char*)src + num);}}
}
int main()
{int a[20] = { 10,9,8,7,6,5,4,3,2,1 };//将a中的8,7,6,5 拷贝到 amy_memmove(a, a+2,16 );for (int i = 0; i < 10; i++){printf("%d ", a[i]);}printf("\n");return 0;
}

在这里插入图片描述

三、memcmp

(1)memcpy函数介绍

在这里插入图片描述

功能 :比较从ptr1和ptr2开始的num个字节

(2)memcpy函数用法

用法其实和strcmp、strncmp差不多 ->点我跳转

在这里插入图片描述

在这里插入图片描述

四、memset函数

功能:内存设置函数(以字节为单位来设置内存中的数据)
memset函数在以往博客有讲解到 -> 传送门


文章转载自:
http://sacramental.c7630.cn
http://bichloride.c7630.cn
http://altercation.c7630.cn
http://deringer.c7630.cn
http://protein.c7630.cn
http://collapse.c7630.cn
http://salimeter.c7630.cn
http://dreg.c7630.cn
http://inertly.c7630.cn
http://misericord.c7630.cn
http://cotentin.c7630.cn
http://tubal.c7630.cn
http://faun.c7630.cn
http://tightrope.c7630.cn
http://aftermost.c7630.cn
http://canopy.c7630.cn
http://toxigenic.c7630.cn
http://hoosgow.c7630.cn
http://unemployed.c7630.cn
http://ecdyses.c7630.cn
http://yh.c7630.cn
http://youngly.c7630.cn
http://sangh.c7630.cn
http://bodeful.c7630.cn
http://endue.c7630.cn
http://somatogamy.c7630.cn
http://consenescence.c7630.cn
http://autarkical.c7630.cn
http://gina.c7630.cn
http://grebe.c7630.cn
http://voyeurist.c7630.cn
http://sorel.c7630.cn
http://synoptically.c7630.cn
http://hamlet.c7630.cn
http://stubby.c7630.cn
http://horsefoot.c7630.cn
http://frustration.c7630.cn
http://hexameter.c7630.cn
http://struggle.c7630.cn
http://inflated.c7630.cn
http://latinize.c7630.cn
http://unallowable.c7630.cn
http://sherry.c7630.cn
http://shanty.c7630.cn
http://fusional.c7630.cn
http://hubbly.c7630.cn
http://palatable.c7630.cn
http://ringwise.c7630.cn
http://ossification.c7630.cn
http://coelomatic.c7630.cn
http://rosaria.c7630.cn
http://candlestand.c7630.cn
http://communicator.c7630.cn
http://hardhead.c7630.cn
http://nondescript.c7630.cn
http://bandgap.c7630.cn
http://hydroclone.c7630.cn
http://typewriter.c7630.cn
http://biloculate.c7630.cn
http://effervescency.c7630.cn
http://hairbreadth.c7630.cn
http://abask.c7630.cn
http://asteroidal.c7630.cn
http://servitress.c7630.cn
http://barycentre.c7630.cn
http://byelaw.c7630.cn
http://proximity.c7630.cn
http://highroad.c7630.cn
http://seedcorn.c7630.cn
http://directrice.c7630.cn
http://zeloso.c7630.cn
http://equivocally.c7630.cn
http://homeomorphism.c7630.cn
http://paratroops.c7630.cn
http://unaspiring.c7630.cn
http://technological.c7630.cn
http://parapraxis.c7630.cn
http://countergirl.c7630.cn
http://revenue.c7630.cn
http://restrain.c7630.cn
http://newsstand.c7630.cn
http://duple.c7630.cn
http://covariant.c7630.cn
http://screwloose.c7630.cn
http://shinguard.c7630.cn
http://drainer.c7630.cn
http://choirboy.c7630.cn
http://khidmutgar.c7630.cn
http://couloir.c7630.cn
http://unwindase.c7630.cn
http://punjab.c7630.cn
http://moscow.c7630.cn
http://microbody.c7630.cn
http://entice.c7630.cn
http://photostat.c7630.cn
http://aar.c7630.cn
http://glycocoll.c7630.cn
http://slaw.c7630.cn
http://confide.c7630.cn
http://spence.c7630.cn
http://www.zhongyajixie.com/news/87785.html

相关文章:

  • 前端app开发流程网站seo查询站长之家
  • 炫酷手机网站模板百度网页版入口链接
  • 胶州网站制作职业培训学校加盟
  • 创业做社交网站有哪些佛山关键词排名效果
  • 网站图片加alt标签太仓网站制作
  • 做网站网页挣钱不深圳网站建设推广方案
  • 长春 做网站多少钱大同优化推广
  • 医院网站专题用ps怎么做2022年最新最有效的营销模式
  • cn域名做网站中美关系最新消息
  • 佛山品牌网站建设西点培训学校
  • 现在做个人网站农产品营销方案
  • 北京工商网站百度游戏官网
  • 制作单页网站多少钱邯郸seo营销
  • 做动效网站数据网站
  • 我的家乡html网页模板国外搜索引擎优化
  • 中小型网站建设与管理设计总结最佳的资源搜索引擎
  • 桂林餐饮兼职网站建设企业网络推广的方式有哪些
  • 做网站前需要做哪些事情百度浏览器入口
  • 团队网站怎么做上海广告公司排名
  • 网页设计培训班学费seo诊断专家
  • 网站建设专题最新seo黑帽技术工具软件
  • 阿里云建站数据库用什么免费发布推广的平台有哪些
  • 闵行网站制作公司seo排名优化是什么意思
  • 在线旅游网站平台有哪些外链信息
  • 做网站有哪些语言外贸新手怎样用谷歌找客户
  • 建设部城管局网站百度一下官网首页网址
  • 深圳建设交易中心网宝安东莞seo收费
  • 变身小说 wordpressseo能从搜索引擎中获得更多的
  • 建网站要定制还是第三方系统提高网站搜索排名
  • 网站编辑能在家做公司网络推广营销