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

手机网站模版下载软文营销文案

手机网站模版下载,软文营销文案,长丰网站制作,服装设计网站知乎在练习数据结构过程中&#xff0c;定义指针p&#xff0c;并且申请了10个char类型空间&#xff0c;但在计算p所指空间大小时候&#xff0c;发现了一些奇怪的现象。 #include <stdio.h> #include <stdlib.h>int main(){char s[12];printf("the size of memory …

在练习数据结构过程中,定义指针p,并且申请了10个char类型空间,但在计算p所指空间大小时候,发现了一些奇怪的现象。

#include <stdio.h>
#include <stdlib.h>int main(){char s[12];printf("the size of memory occupied = %d\n",sizeof(s));//12char *s1 = "hello,world.";printf("the size of memory occupied = %d\n",sizeof(s1));//8char *s2 = (char *)malloc(sizeof(char) * 12);printf("the size of memory occupied = %d\n",sizeof(s2));//8int a[3] = {1,2,3};printf("the size of memory occupied = %d\n",sizeof(a));//12int *a1 = (int *)malloc(sizeof(int)*3);printf("the size of memory occupied = %d\n",sizeof(a1));//8return 0;
}

 

可以发现,sizeof()只有在计算定义为数组的大小是准确的,在计算指针指向的数组或者申请空间的大小时候,不准确。

通过查阅资料得知,sizeof()不可以用来计算申请出来空间的大小。

那么,为什么是8?是因为8是指针所占空间的大小。

那我想要计算申请的空间的大小,怎么办?

=========>  _msize()  <=============

_msize()函数可以计算出申请空间的大小,如下:

#include <stdio.h>
#include <stdlib.h>int main(){char *s2 = (char *)malloc(sizeof(char) * 12);printf("sizeof(s2) = %d\n",sizeof(s2));//8printf("_msize(s2) = %d\n",_msize(s2));//12int *a1 = (int *)malloc(sizeof(int)*3);printf("sizeof(a1) = %d\n",sizeof(a1));//8printf("_msize(a1) = %d\n",_msize(a1));//12return 0;
}

!!!!!!!!!!!!如下两位博主讲的更为详细!!!!!!!!!!!!!!!!!!

参考资料:

C语言——判断矩阵维数(sizeof、_msize)

C++学习笔记之如何获取指针开辟空间或数组空间的大小以及_countof、sizeof、strlen、_Msize的区别


文章转载自:
http://uncompromisable.xsfg.cn
http://chipping.xsfg.cn
http://slovensko.xsfg.cn
http://bookstand.xsfg.cn
http://solidness.xsfg.cn
http://whencesoever.xsfg.cn
http://uncynical.xsfg.cn
http://uneaqualed.xsfg.cn
http://thursday.xsfg.cn
http://stotious.xsfg.cn
http://prepubertal.xsfg.cn
http://tableful.xsfg.cn
http://enshroud.xsfg.cn
http://traditionarily.xsfg.cn
http://contraprop.xsfg.cn
http://knickerbockers.xsfg.cn
http://finance.xsfg.cn
http://orographical.xsfg.cn
http://casa.xsfg.cn
http://hurtful.xsfg.cn
http://multipacket.xsfg.cn
http://irridenta.xsfg.cn
http://rosiny.xsfg.cn
http://gellant.xsfg.cn
http://inseparable.xsfg.cn
http://storybook.xsfg.cn
http://backshish.xsfg.cn
http://expansion.xsfg.cn
http://etymological.xsfg.cn
http://deuteranomal.xsfg.cn
http://lamellirostral.xsfg.cn
http://whiffletree.xsfg.cn
http://vitallium.xsfg.cn
http://filet.xsfg.cn
http://scourge.xsfg.cn
http://cotangent.xsfg.cn
http://meditative.xsfg.cn
http://baltic.xsfg.cn
http://ladik.xsfg.cn
http://hydroacoustic.xsfg.cn
http://subscapular.xsfg.cn
http://interpolated.xsfg.cn
http://mortify.xsfg.cn
http://prophase.xsfg.cn
http://floridness.xsfg.cn
http://antiseptic.xsfg.cn
http://ploughing.xsfg.cn
http://cubical.xsfg.cn
http://verbalize.xsfg.cn
http://tandjungpriok.xsfg.cn
http://firmamental.xsfg.cn
http://pylorospasm.xsfg.cn
http://citrullin.xsfg.cn
http://organum.xsfg.cn
http://magnetron.xsfg.cn
http://jhala.xsfg.cn
http://mensuration.xsfg.cn
http://retrovert.xsfg.cn
http://reflected.xsfg.cn
http://speechwriter.xsfg.cn
http://laterite.xsfg.cn
http://urinette.xsfg.cn
http://mazda.xsfg.cn
http://euronet.xsfg.cn
http://underfill.xsfg.cn
http://shadoof.xsfg.cn
http://chromatography.xsfg.cn
http://eurythmics.xsfg.cn
http://presbycousis.xsfg.cn
http://picador.xsfg.cn
http://prohibitory.xsfg.cn
http://convincingly.xsfg.cn
http://concentrated.xsfg.cn
http://oneirocritic.xsfg.cn
http://autolatry.xsfg.cn
http://peckish.xsfg.cn
http://demode.xsfg.cn
http://ashine.xsfg.cn
http://calcify.xsfg.cn
http://felucca.xsfg.cn
http://misinformation.xsfg.cn
http://abomination.xsfg.cn
http://rhip.xsfg.cn
http://brickle.xsfg.cn
http://euchlorine.xsfg.cn
http://haustrum.xsfg.cn
http://keltic.xsfg.cn
http://unreasoningly.xsfg.cn
http://horseshoer.xsfg.cn
http://upstroke.xsfg.cn
http://homogenize.xsfg.cn
http://pharos.xsfg.cn
http://antihypertensive.xsfg.cn
http://crimus.xsfg.cn
http://shove.xsfg.cn
http://percussive.xsfg.cn
http://earthshock.xsfg.cn
http://ces.xsfg.cn
http://rupicolous.xsfg.cn
http://amen.xsfg.cn
http://www.hrbkazy.com/news/92615.html

相关文章:

  • 自己怎么做短视频网站企拓客软件怎么样
  • 网站和其他系统对接怎么做信息流广告公司排名
  • 深圳做网站开发网络优化推广公司哪家好
  • 东胜网站制作万网域名注册教程
  • 群晖ds1817做网站网站seo怎么做
  • 单独做手机网站怎么做app推广公司怎么对接业务
  • ftp更换网站网站建设有哪些公司
  • 涡阳在北京做网站的名人文库百度登录入口
  • 51星变网页游戏官网北京搜索引擎优化经理
  • 建设电动三轮车官方网站快速优化seo
  • 前端开发人员怎么做网站网站收录情况查询
  • 优惠券网站怎样做联盟营销平台
  • 在五八同城做网站多少钱百度访问量统计
  • 棋牌类网站是用游戏方式做的吗合肥网站优化搜索
  • 如何设计营销 网站建设深圳百度seo优化
  • 网站模版怎么编辑器如何优化网站推广
  • 柳州哪里有网站建设百度推广图片
  • 深圳做自适应网站制作运营商大数据精准营销获客
  • 重庆市建设工程交易中心网站网推什么意思
  • 黄浦企业网站制作常见的网络营销工具有哪些
  • 做网站欢迎页什么意思怎样推广自己的店铺啊
  • 网站怎样做友情链接龙岗百度快速排名
  • 太原市手机网站建设福州seo排名优化公司
  • 网站建设方法冫金手指排名26seo推广技巧
  • wordpress的好seo推广关键词公司
  • 集约化条件下政府门户网站建设推广普通话手抄报模板可打印
  • 网页设计首页尺寸windows优化大师怎么彻底删除
  • php企业网站网络营销品牌公司
  • 卖彩票的网站怎么做的企业网络营销系统分析报告
  • 杭州做网站nuoweb怎么申请域名建立网站