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

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

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

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

廣告

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

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