作者jch660tw (阿渝)
看板TransCSI
標題[問題] C++指標問題
時間Mon Apr 14 10:32:17 2014
int *p = new int;
Int *q=p;
*q=10;
delete p;
p = NULL;
What the value does the variable q contain?
每次做到指標的題目都卡住,懇請各位詳解謝謝!
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 42.78.35.34
※ 文章網址: http://webptt.com/m.aspx?n=bbs/TransCSI/M.1397442740.A.4BE.html
1F:→ tszyi:因為p指向的記憶體被釋放,所以q指到的值是不確定。 04/16 20:57