z*********n 发帖数: 203 | 1 Is anything wrong here?
int * n1 = NULL;
int * & n2 = n1;
n2 = new int(1);
delete n1;
n2 = new int(2);
delete n1; |
j*****y 发帖数: 1071 | 2 seems nothing wrong ?
【在 z*********n 的大作中提到】 : Is anything wrong here? : int * n1 = NULL; : int * & n2 = n1; : n2 = new int(1); : delete n1; : n2 = new int(2); : delete n1;
|
z*********n 发帖数: 203 | 3 你确定?
how about this:
void foo(int * & n){}
【在 j*****y 的大作中提到】 : seems nothing wrong ?
|
s**x 发帖数: 7506 | |
s***0 发帖数: 117 | 5 Horrible code. Go read how new() and delete() work.
【在 z*********n 的大作中提到】 : Is anything wrong here? : int * n1 = NULL; : int * & n2 = n1; : n2 = new int(1); : delete n1; : n2 = new int(2); : delete n1;
|
z*********n 发帖数: 203 | 6 horrible,但是好像没有错
【在 s***0 的大作中提到】 : Horrible code. Go read how new() and delete() work.
|
p*****p 发帖数: 379 | |
d**********x 发帖数: 4083 | 8 题目似乎就抄错了。。
【在 z*********n 的大作中提到】 : Is anything wrong here? : int * n1 = NULL; : int * & n2 = n1; : n2 = new int(1); : delete n1; : n2 = new int(2); : delete n1;
|