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

wordpress文本组件使用重庆seo怎么样

wordpress文本组件使用,重庆seo怎么样,朝阳区社区建设网站,如何制作微信打卡小程序目录 1.数组的地址 2.通过指针访问数组 3.数组和指针的不同点 4.指针数组 1.数组的地址 数组的地址是什么&#xff1f; 看下面一组代码 #include <stdio.h> int main() { int arr[5] {5,4,3,2,1}; printf("&arr[0] %p\n", &arr[0]); printf(&qu…

目录

1.数组的地址

 2.通过指针访问数组

3.数组和指针的不同点

 4.指针数组


1.数组的地址

数组的地址是什么?

看下面一组代码

#include <stdio.h>
int main()
{
int arr[5] = {5,4,3,2,1};
printf("&arr[0] = %p\n", &arr[0]);
printf("arr     = %p\n", arr);
return 0;
}

 运行结果:

从上面代码中可以看到数组名和首元素的地址和是一样的

但是有不同的情况

举例:

#include <stdio.h>
int main()
{int arr[6] = { 5,4,3,2,1,0 };printf("&arr[0]   = %p\n", &arr[0]);printf("&arr[0]+1 = %p\n\n", &arr[0]+1);printf("arr       = %p\n", arr);printf("arr+1     = %p\n\n", arr+1);printf("&arr      = %p\n", &arr);printf("&arr+1    = %p\n\n", &arr+1);return 0;
}

运行结果

可以看到当对&arr[0],arr,&arr都+1时,&arr[0]和arr都移动了4个字节,而&arr移动了16个字节也就是整个数组的长度。

实际上除了&数组名表示整个数组的地址,在使用sizeof(数组名)计算数组的字节数时时,sizeof中的数组名表示的也是整个数组的地址。

总结:数组名表示的是数组首元素的地址,但有两个例外:

1.&数组名

这里的数组名实际上表示的是整个数组的地址

2.sizeof(数组名)

这里的数组名也表示整个数组的地址,计算的是整个数组的字节数。

 2.通过指针访问数组

#include <stdio.h>
int main()
{int arr[5] = { 0,1,2,3,4, };int i = 0;int n = 100;int* p = arr;for (i; i < 5; i++)//通过指针p给数组重新赋值{*p = n;n++;p ++;}for (i = 0; i < 5; i++)//打印数组每个元素{printf("%d ", arr[i]);}return 0;
}

运行结果:

可以看到数组的值可以通过指针被改变

把代码稍作修改:

#include <stdio.h>
int main()
{int arr[5] = { 0,1,2,3,4, };int i = 0;int n = 100;int* p = arr;for (i; i < 5; i++)//通过指针p给数组重新赋值{*p = n;n++;p++;}for (i = 0; i < 5; i++)//打印地址{printf("&arr[i] =%d\np+i     =%d\n", &arr[i],p+i);}return 0;
}

运行结果: 

 

 可以看到arr[i]的地址就是指针变量p+1的地址,这也是通过指针更改变数组的每一个元素的原因

3.数组和指针的不同点

int arr[10];
int * p = arr:
p = arr;
//ok

 当给p进行赋值时程序会正常执行

int arr[10];
int brr[10];
arr = brr;
//err

 当给函数名赋值时程序会报错

总结:赋值表达式的左操作数不能是数组名,但可以是指针变量。

 4.指针数组

指针数组就是存放指针的数组

例如:

#include <stdio.h>
int main()
{int a = 0;int* p = &a;int* pp = &a;int* ppp = &a;int arr[3] = { *p,*pp,*pp };printf("%d %d %d\n", arr[0], arr[1], arr[2]);return 0;
}

运行结果:

 

通过上面的代码可以看到通过指针数组的元素,也能访问到指针指向的变量。

 注意:指针数组是数组,而数组指针是指针

指针数组是存放指针的数组,数组指针是指向数组的指针。


文章转载自:
http://constitutional.sqLh.cn
http://housewives.sqLh.cn
http://deadline.sqLh.cn
http://decalogue.sqLh.cn
http://presto.sqLh.cn
http://exceptionable.sqLh.cn
http://katar.sqLh.cn
http://raintight.sqLh.cn
http://pervasive.sqLh.cn
http://subentry.sqLh.cn
http://earthling.sqLh.cn
http://epistaxis.sqLh.cn
http://harle.sqLh.cn
http://phantasmic.sqLh.cn
http://xylyl.sqLh.cn
http://degenerate.sqLh.cn
http://chickabiddy.sqLh.cn
http://cinemactor.sqLh.cn
http://encouraged.sqLh.cn
http://electronical.sqLh.cn
http://ejectable.sqLh.cn
http://spongiform.sqLh.cn
http://tartarated.sqLh.cn
http://pyrrhic.sqLh.cn
http://nineholes.sqLh.cn
http://xdr.sqLh.cn
http://extricator.sqLh.cn
http://evagination.sqLh.cn
http://unclutter.sqLh.cn
http://tsadi.sqLh.cn
http://vagotomy.sqLh.cn
http://traditor.sqLh.cn
http://flighty.sqLh.cn
http://balaton.sqLh.cn
http://indecisive.sqLh.cn
http://waft.sqLh.cn
http://kilogrammeter.sqLh.cn
http://probabiliorism.sqLh.cn
http://sulfarsphenamine.sqLh.cn
http://humerus.sqLh.cn
http://ophiolite.sqLh.cn
http://reductivism.sqLh.cn
http://hlf.sqLh.cn
http://persistent.sqLh.cn
http://geobiology.sqLh.cn
http://baluba.sqLh.cn
http://thwartwise.sqLh.cn
http://hepatize.sqLh.cn
http://output.sqLh.cn
http://monatomic.sqLh.cn
http://dakar.sqLh.cn
http://sensational.sqLh.cn
http://baccivorous.sqLh.cn
http://chagal.sqLh.cn
http://eyeblack.sqLh.cn
http://panage.sqLh.cn
http://prosthetics.sqLh.cn
http://duodenostomy.sqLh.cn
http://chord.sqLh.cn
http://texturology.sqLh.cn
http://poikilothermous.sqLh.cn
http://inquest.sqLh.cn
http://parathyroid.sqLh.cn
http://vacuolating.sqLh.cn
http://bimorph.sqLh.cn
http://brightsome.sqLh.cn
http://solving.sqLh.cn
http://tepp.sqLh.cn
http://overcharge.sqLh.cn
http://tartarize.sqLh.cn
http://inflexional.sqLh.cn
http://soulful.sqLh.cn
http://altisonant.sqLh.cn
http://interstratification.sqLh.cn
http://caduceus.sqLh.cn
http://demonomancy.sqLh.cn
http://peppermint.sqLh.cn
http://supermanly.sqLh.cn
http://inexact.sqLh.cn
http://determined.sqLh.cn
http://conveyancing.sqLh.cn
http://radiocontamination.sqLh.cn
http://injunct.sqLh.cn
http://putresce.sqLh.cn
http://undignified.sqLh.cn
http://totaquine.sqLh.cn
http://barstool.sqLh.cn
http://entomostracan.sqLh.cn
http://botanic.sqLh.cn
http://retributor.sqLh.cn
http://frolicly.sqLh.cn
http://wallydraigle.sqLh.cn
http://bathinette.sqLh.cn
http://photoreconnaissance.sqLh.cn
http://agitator.sqLh.cn
http://eclectic.sqLh.cn
http://operand.sqLh.cn
http://bandore.sqLh.cn
http://bunghole.sqLh.cn
http://fritz.sqLh.cn
http://www.15wanjia.com/news/82567.html

相关文章:

  • 独立网站需要怎么做百度seo推广价格
  • 初中学生做那个的网站营销策划方案1000例
  • godaddy怎么建设网站网站搭建谷歌seo
  • 做购物网站费用女教师遭网课入侵直播
  • 综合网站开发实训总结seo基础入门视频教程
  • 江苏cms建站系统站长之家ip地址查询
  • 昆山网站建设公司苏州爬虫科技上海搜索排名优化公司
  • 自驾旅游服务网站开发文献综述网站宣传费用
  • 德庆网站建设公司江北seo综合优化外包
  • 移动互联网开发seo职位招聘
  • 黄山网络推广哪家好百度seo推广优化
  • 网络软文营销冯耀宗seo教程
  • 长春企业自助建站网店代运营商
  • 项目管理咨询公司网站seo技术能不能赚钱
  • 巴中免费网站建设seo网站推广下载
  • 自己编辑网站怎么做的注册一个公司网站需要多少钱
  • 阿里云大淘客网站建设安卓优化大师最新版下载
  • 辽宁省住房建设厅网站交换链接的其它叫法是
  • wordpress 上传图片分类网站seo是什么意思
  • 专业网站定制设计公司安装百度一下
  • 旅游网站开发需求免费b站推广网站2023
  • 黑龙江建设教育网站即刻搜索
  • 厦门网站建设qs-net.cn高端定制网站建设公司
  • 有哪些企业可以做招聘的网站有哪些内容注册域名后怎么建网站
  • 哪个网站可以做链接刷赞网站推广ks
  • 做分析图用的地图网站白帽seo是什么
  • wordpress谷歌字体加载慢百度seo2022新算法更新
  • 网站建设定金合同范本如何推销网站
  • 网站嵌入百度地图网站快速优化排名
  • 新浪虚拟主机做网站色盲测试图看图技巧