M
mescaline
Hi,
suppose I do:
class One{};
int main(){
One * A = new One[100];
// an array of objects on the heap ...
delete A; // instead of delete []A;
return 0;
}
.... I read in Eckel, that "this releases the proper amount of storage"
-- How?
Also, then there is no memory leak, right?
What are the disadvantages of doing the above then instead of "delete []A;"?
thanks
m
suppose I do:
class One{};
int main(){
One * A = new One[100];
// an array of objects on the heap ...
delete A; // instead of delete []A;
return 0;
}
.... I read in Eckel, that "this releases the proper amount of storage"
-- How?
Also, then there is no memory leak, right?
What are the disadvantages of doing the above then instead of "delete []A;"?
thanks
m