指針訪問(wèn)數(shù)組元素-創(chuàng)新互聯(lián)

成都創(chuàng)新互聯(lián)公司秉承實(shí)現(xiàn)全網(wǎng)價(jià)值營(yíng)銷的理念,以專業(yè)定制企業(yè)官網(wǎng),網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì),重慶小程序開(kāi)發(fā)公司,網(wǎng)頁(yè)設(shè)計(jì)制作,成都做手機(jī)網(wǎng)站,成都全網(wǎng)營(yíng)銷推廣幫助傳統(tǒng)企業(yè)實(shí)現(xiàn)“互聯(lián)網(wǎng)+”轉(zhuǎn)型升級(jí)專業(yè)定制企業(yè)官網(wǎng),公司注重人才、技術(shù)和管理,匯聚了一批優(yōu)秀的互聯(lián)網(wǎng)技術(shù)人才,對(duì)客戶都以感恩的心態(tài)奉獻(xiàn)自己的專業(yè)和所長(zhǎng)。>#include <stdio.h> 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; // 此時(shí) *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 // 此時(shí) 數(shù)組為 [99, 0] p指向數(shù)組中的首元素(99) // 數(shù)組指針訪問(wèn)數(shù)組元素,只要在 地址不斷加1 即向下移動(dòng)一個(gè)單元 for (int i = 0; i < 2; i++) { printf("array %d %d ", i, *(p + i)); } }

網(wǎng)站標(biāo)題:指針訪問(wèn)數(shù)組元素-創(chuàng)新互聯(lián)
分享地址:http://muchs.cn/article18/dpohdp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供動(dòng)態(tài)網(wǎng)站、網(wǎng)站維護(hù)、建站公司、外貿(mào)網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì)、網(wǎng)頁(yè)設(shè)計(jì)公司

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

成都網(wǎng)站建設(shè)