hi frnz..
have a bit of trouble here...:(
i am allocating a dynamic integer array...
after allocation i assign different values to every array element.
now what i wish to do is to delete the array and free the memory element by element & not as a whole array at once.
(i.e)
void main()
{
int col =5;
int *arr=new int[col];
arr[0]=1;
arr[1]=2;
arr[2]=3;
arr[3]=4;
arr[4]=5;
getch();
}
on performing
delete[] arr;
the whole memory is deallocated, but what i wish to do is to first delete and free the memory of arr[0],then arr[1] and so on till arr[4].
the thing is that i want to delete 4 bytes at a time...i dont wish to delete the whole 20 bytes at one go...
how to perform this????