“delete [] a,b; ” 的格式对吗?
“delete [] a,b; ” 的格式对吗?
程序:
int n=100;
int *a,*b;
a=new int [n];
b=new int [n];
delete [] a,b; //这样格式对吗?


[此贴子已经被作者于2006-10-13 10:26:30编辑过]
“delete [] a,b; ” 的格式对吗?
程序:
int n=100;
int *a,*b;
a=new int [n];
b=new int [n];
delete [] a,b; //这样格式对吗?


[此贴子已经被作者于2006-10-13 10:26:30编辑过]
2006-10-13 10:24
2006-10-13 10:35
为什么N在前面呢
2006-10-13 11:30
2006-10-13 16:16
2006-10-13 20:28
恩,C里常用的是mallloc 和free();

2006-10-13 20:50
2006-10-13 21:20
没见过这种形式.
我只见过
delete []a; 这种形式
在哪见过,能举个例子吗?

2006-10-13 21:33
在哪见过,能举个例子吗?
我在书上查到了,
delete [n] a;
delete [] a;
这两种格式都对,都是对动态数组的释放.delete [n] a;是比较老的写法.
书上说两种写法效果完全一样,

2006-10-13 21:44

2006-10-13 21:59