[問題] C++指標問題

作者: jch660tw (阿渝)   2014-04-14 10:32:17
int *p = new int;
Int *q=p;
*q=10;
delete p;
p = NULL;
What the value does the variable q contain?
每次做到指標的題目都卡住,懇請各位詳解謝謝!
作者: tszyi (奶茶加撞球)   2014-04-16 20:57:00
因為p指向的記憶體被釋放,所以q指到的值是不確定。

Links booklink

Contact Us: admin [ a t ] ucptt.com