指针访问数组元素-创新互联

成都创新互联公司秉承实现全网价值营销的理念,以专业定制企业官网,网站建设、网站设计,重庆小程序开发公司,网页设计制作,成都做手机网站成都全网营销推广帮助传统企业实现“互联网+”转型升级专业定制企业官网,公司注重人才、技术和管理,汇聚了一批优秀的互联网技术人才,对客户都以感恩的心态奉献自己的专业和所长。>#include int *p = (int[]){8, 7}; // creates an unnamed static array of type int[2] // initializes the array to the values {2, 4} // creates pointer p to point at the first element of the arrayvoid main(void) { int n = 99, *p = &n; // 此时 *p == 99; printf("n: %d ", *p); p= (int [2]){*p}; // creates an unnamed automatic array of type int[2] // initializes the first element to the value formerly held in *p // initializes the second element to zero // stores the address of the first element in p // 此时 数组为 [99, 0] p指向数组中的首元素(99) // 数组指针访问数组元素,只要在 地址不断加1 即向下移动一个单元 for (int i = 0; i < 2; i++) { printf("array %d %d ", i, *(p + i)); } }
文章题目:指针访问数组元素-创新互联
转载注明:http://www.kmzsk.com/article/dpohdp.html

其他资讯

Copyright © 2026 昆明姝彩聂商贸有限公司 All Rights Reserved 滇ICP备2025072963号-9
友情链接: 成都网站建设 网站建设推广 网站设计 攀枝花网站设计 成都企业网站建设 定制网站设计 品牌网站建设 定制网站设计 高端网站设计 网站建设公司 成都网站建设流程 成都网站制作 自适应网站建设 成都网站制作 企业网站设计 网站制作 成都网站建设 成都网站建设 成都网站设计制作公司 高端网站设计推广 成都网站建设 梓潼网站设计