[问题] 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