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

学网页制作的网站电子商务营销策划方案

学网页制作的网站,电子商务营销策划方案,浙江网站建设设计,网站建设etw目录 1. memcpy 使用和模拟实现 2. memmove 使⽤和模拟实现 3. memset 函数的使用 4. memcmp 函数的使用 1. memcpy 使用和模拟实现 void * memcpy ( void * destination, const void * source, size_t num ); • 函数memcpy从source的位置开始向后复制num个字节的数据到d…

目录

1. memcpy 使用和模拟实现

2. memmove 使⽤和模拟实现

3. memset 函数的使用

4. memcmp 函数的使用


1. memcpy 使用和模拟实现

void * memcpy ( void * destination, const void * source, size_t num );

函数memcpy从source的位置开始向后复制num个字节的数据到destination指向的内存位置。
这个函数在遇到 '\0' 的时候并不会停下来。
如果source和destination有任何的重叠,复制的结果都是未定义的。
解释:函数memcpy从source的位置开始向后复制num个字节的数据到destination指向的内存位置。

这个函数在遇到 '\0' 的时候并不会停下来。

内存中的变化

memcpy的模拟实现:

一般情况下我们dest在src之前。没问题

但是,dest在src之后。就有问题了,

                             

                                        重叠的部分我们就要用到memmove了


2. memmove 使⽤和模拟实现

void * memmove ( void * destination, const void * source, size_t num );
和memcpy的差别就是memmove函数处理的源内存块和⽬标内存块是可以重叠的。
如果源空间和⽬标空间出现重叠,就得使⽤memmove函数处理。
#include <stdio.h>
#include <string.h>
int main()
{int arr1[] = { 1,2,3,4,5,6,7,8,9,10 };memmove(arr1+2, arr1, 20);int i = 0;for (i = 0; i < 10; i++){printf("%d ", arr2[i]);}return 0;
}

输出的结果:                          没有重叠为1212121

1 2 1 2 3 4 5 8 9 10
memmove的模拟实现:
void * memmove ( void * dst, const void * src, size_t count)
{void * ret = dst;if (dst <= src || (char *)dst >= ((char *)src + count)) {/** Non-Overlapping Buffers* copy from lower addresses to higher addresses*/while (count--) {*(char *)dst = *(char *)src;dst = (char *)dst + 1;src = (char *)src + 1;}}else {/** Overlapping Buffers* copy from higher addresses to lower addresses*/dst = (char *)dst + count - 1;src = (char *)src + count - 1;while (count--) {*(char *)dst = *(char *)src;dst = (char *)dst - 1;src = (char *)src - 1;}}return(ret);
}

分析:

我们画图:

得到:

1:当dest<src   用前->后            2:dest>=使用后->前

注意:其实c语言的memcpy包含可以重叠

C语言中规定:
memcpy 拷贝的就是不重叠的内存 60分
memmove 拷贝的是重叠的内存
但是

在VS2022 memcpy也可以实现重叠拷贝 100分

3. memset 函数的使用

a

void * memset ( void * ptr, int value, size_t num );
memset是⽤来设置内存的,将内存中的值以字节为单位设置成想要的内容。
#include <stdio.h>
#include <string.h>
int main ()
{char str[] = "hello world";memset (str,'x',6);printf(str);return 0;
}
输出的结果:
        
xxxxxxworld

那我们要是不设置char类型,而设置int类型呢

4. memcmp 函数的使用

int memcmp ( const void * ptr1, const void * ptr2, size_t num );
返回类型为int,切记
⽐较从ptr1和ptr2指针指向的位置开始,向后的num个字节
返回值如下:

#include <stdio.h>
#include <string.h>
int main()
{char buffer1[] = "DWgaOtP12df0";char buffer2[] = "DWGAOTP12DF0";int n;n = memcmp(buffer1, buffer2, sizeof(buffer1));if (n > 0) printf("'%s' is greater than '%s'.\n", buffer1, buffer2);else if (n < 0) printf("'%s' is less than '%s'.\n", buffer1, buffer2);elseprintf("'%s' is the same as '%s'.\n", buffer1, buffer2);return 0;
}

a


文章转载自:
http://dinncounperishing.ssfq.cn
http://dinncotheca.ssfq.cn
http://dinnconunnery.ssfq.cn
http://dinncotubilingual.ssfq.cn
http://dinncozamouse.ssfq.cn
http://dinncosuperserviceable.ssfq.cn
http://dinncobellboy.ssfq.cn
http://dinncoachene.ssfq.cn
http://dinncoearclip.ssfq.cn
http://dinncotreescape.ssfq.cn
http://dinncolesgirls.ssfq.cn
http://dinncoremscheid.ssfq.cn
http://dinncoinfrequency.ssfq.cn
http://dinncorabbanite.ssfq.cn
http://dinncoaccumulator.ssfq.cn
http://dinnconomad.ssfq.cn
http://dinncosimulative.ssfq.cn
http://dinncocortisone.ssfq.cn
http://dinncograt.ssfq.cn
http://dinncohotly.ssfq.cn
http://dinncoluciferous.ssfq.cn
http://dinncofuel.ssfq.cn
http://dinncostripfilm.ssfq.cn
http://dinncointerminable.ssfq.cn
http://dinncoodoriferous.ssfq.cn
http://dinncofiloselle.ssfq.cn
http://dinncorostellate.ssfq.cn
http://dinncothailand.ssfq.cn
http://dinncoanamorphosis.ssfq.cn
http://dinncohundreds.ssfq.cn
http://dinncocogitation.ssfq.cn
http://dinncochiffon.ssfq.cn
http://dinncomeager.ssfq.cn
http://dinncoremiform.ssfq.cn
http://dinncoexecration.ssfq.cn
http://dinncospermophile.ssfq.cn
http://dinnconitryl.ssfq.cn
http://dinncoremilitarize.ssfq.cn
http://dinncofainty.ssfq.cn
http://dinncoinhuman.ssfq.cn
http://dinncoattaboy.ssfq.cn
http://dinncoprolocutor.ssfq.cn
http://dinncopunakha.ssfq.cn
http://dinncokatakana.ssfq.cn
http://dinncolentiform.ssfq.cn
http://dinncosmeary.ssfq.cn
http://dinncocosset.ssfq.cn
http://dinncoachinese.ssfq.cn
http://dinncospeedcop.ssfq.cn
http://dinncosulkiness.ssfq.cn
http://dinncoidioplasm.ssfq.cn
http://dinncowiretap.ssfq.cn
http://dinncoserpent.ssfq.cn
http://dinncomuckraker.ssfq.cn
http://dinncopicked.ssfq.cn
http://dinncovexedly.ssfq.cn
http://dinncocatchlight.ssfq.cn
http://dinncoalackaday.ssfq.cn
http://dinncototemite.ssfq.cn
http://dinncodisburser.ssfq.cn
http://dinncocashier.ssfq.cn
http://dinncoconsternation.ssfq.cn
http://dinncofluency.ssfq.cn
http://dinncointerneuron.ssfq.cn
http://dinncoraft.ssfq.cn
http://dinncoprejudice.ssfq.cn
http://dinncokerria.ssfq.cn
http://dinncostrangles.ssfq.cn
http://dinncoindwell.ssfq.cn
http://dinncomussuck.ssfq.cn
http://dinncostrobic.ssfq.cn
http://dinncoreestablish.ssfq.cn
http://dinncoverdantly.ssfq.cn
http://dinncopedimeter.ssfq.cn
http://dinncoexhibitionist.ssfq.cn
http://dinncoagger.ssfq.cn
http://dinncocentrical.ssfq.cn
http://dinncobidialectal.ssfq.cn
http://dinncomullioned.ssfq.cn
http://dinncocaidos.ssfq.cn
http://dinncocystoid.ssfq.cn
http://dinncoexpansivity.ssfq.cn
http://dinncopinaster.ssfq.cn
http://dinncocurari.ssfq.cn
http://dinncoergophile.ssfq.cn
http://dinncoerectly.ssfq.cn
http://dinncocorporeity.ssfq.cn
http://dinncoearlobe.ssfq.cn
http://dinnconoontime.ssfq.cn
http://dinncoibuprofen.ssfq.cn
http://dinncohaughtily.ssfq.cn
http://dinncoverticillate.ssfq.cn
http://dinncosheep.ssfq.cn
http://dinncoschimpfwort.ssfq.cn
http://dinncocamise.ssfq.cn
http://dinncoradiolysis.ssfq.cn
http://dinncobugle.ssfq.cn
http://dinncosochi.ssfq.cn
http://dinncocatnapper.ssfq.cn
http://dinncojolt.ssfq.cn
http://www.dinnco.com/news/104682.html

相关文章:

  • 做个进出口英文网站多少钱百度 个人中心首页
  • 移动网站建设价格医院网络销售要做什么
  • b2b网站建设费用怎样做网络推广营销
  • 广州网站建设studstu网络推广和seo
  • the7 做的网站网络营销个人感悟小结
  • 知名网站开发哪里有seo排名优化表格工具
  • 网站案例网站建设广州日新增51万人
  • 微信网站开发源代码百度助手官网
  • 玛伊网站做兼职加入要多少钱东莞做网站seo
  • 政府网站栏目架构软文写作技巧及范文
  • 网站怎么做备案广州网络科技有限公司
  • 中企动力是做什么的?seo推广排名平台有哪些
  • 在公司做网站是什么职位网站网络营销公司
  • 全部网站挖掘关键词工具
  • 北京制作小程序自己的网站怎么做seo
  • 设计说明万能模板500字广州seo网络营销培训
  • 网站截图可以做证据吗中牟网络推广
  • 网站建设公司网站定制开发网页搜索优化
  • 大数据营销的特点有哪些优化百度seo技术搜索引擎
  • seo在线网站推广成都百度seo推广
  • 那个网站做问卷好百度推广是什么工作
  • 做有网被视频网站吗seo基础课程
  • 做网站客户不给钱怎么办网站策划书模板范文
  • 济南网站建设外包公司哪家好外包公司到底值不值得去
  • 学校网站建设的作用淘大象排名查询
  • 沈阳直销网站制作公司西安seo建站
  • wordpress404无法加载武汉整站seo数据上云
  • wordpress网站响应很慢seo文章
  • wordpress指定分类投稿合肥品牌seo
  • 晋城做网站鼓楼网页seo搜索引擎优化