第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

“取消引用”指針是什么意思?

“取消引用”指針是什么意思?

C++ C
守著星空守著你 2019-06-06 14:49:21
“取消引用”指針是什么意思?請(qǐng)舉例說(shuō)明。
查看完整描述

3 回答

?
回首憶惘然

TA貢獻(xiàn)1847條經(jīng)驗(yàn) 獲得超11個(gè)贊

刪除指針意味著獲取存儲(chǔ)在指針指向的內(nèi)存位置中的值。操作符*用于執(zhí)行此操作,并稱為取消引用運(yùn)算符。

int a = 10;int* ptr = &a;printf("%d", *ptr); // With *ptr I'm dereferencing the pointer. 
                    // Which means, I am asking the value pointed at by the pointer.
                    // ptr is pointing to the location in memory of the variable a.
                    // In a's location, we have 10. So, dereferencing gives this value.
                    // Since we have indirect control over a's location, we can modify its content using the pointer. 
                    This is an indirect way to access a.

 *ptr = 20;         // Now a's content is no longer 10, and has been modified to 20.


查看完整回答
反對(duì) 回復(fù) 2019-06-06
?
汪汪一只貓

TA貢獻(xiàn)1898條經(jīng)驗(yàn) 獲得超8個(gè)贊

指針是對(duì)值的“引用”。就像圖書館的電話號(hào)碼是一本書的參考。電話號(hào)碼正在物理上通過(guò)并檢索那本書。

int a=4 ;int *pA = &a ;printf( "The REFERENCE/call number for the variable `a` is %p\n", pA ) ;// The * causes pA to DEREFERENCE...  
`a` via "callnumber" `pA`.printf( "%d\n", *pA ) ; // prints 4..

如果書不在那里,圖書管理員就大聲叫喊,關(guān)閉圖書館,幾個(gè)人準(zhǔn)備調(diào)查一個(gè)人找不到書的原因。


查看完整回答
反對(duì) 回復(fù) 2019-06-06
  • 3 回答
  • 0 關(guān)注
  • 1602 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)