S
Sabiyur
Hi All,
I am coding as below.
int *x = new int[10];
int * y= x;
............
.............
del [] y;
x=NULL;
When we are freeing the array, it should free the all memory locations
corresponding to all elements.
The compiler stores the number of elements of array, and releases the
memory accordingly.
So If we use del [] y; Does it knows how many locations to delete?
Becuae y is just copy of x.
I don't know how to test this case. Please help me.
Thanks
Sabiyur
I am coding as below.
int *x = new int[10];
int * y= x;
............
.............
del [] y;
x=NULL;
When we are freeing the array, it should free the all memory locations
corresponding to all elements.
The compiler stores the number of elements of array, and releases the
memory accordingly.
So If we use del [] y; Does it knows how many locations to delete?
Becuae y is just copy of x.
I don't know how to test this case. Please help me.
Thanks
Sabiyur