sorry

If we use a dynamically allocated pointer to print array elements.. Then after deleting pointer we can again use that pointer to print array elements. How?
Last edited on
You buy a house in lot X and then abandon it. How is the house still there (lot X) after you abandon it?

Yes, the house is still there until another guy buys it and builds another house on lot X.


you = pointer
buy = dynamically allocate
house = array element
lot = memory address
abandon = delete / free memory. Abandon does not destroy the house, but it does empty that house (call the destructor)
Last edited on
Thanks brother I was very confuse Again Thanks A lot
closed account (Dy7SLyTq)
you should put this in general programming... and also that isnt completely correct. arrays dont have a destructor. a dynamic pointer points to a possibly variable amount of memory that can only be used by that pointer, (well it might be able to be used by something else, but it will be very dangerous and probably fatal). then when you delete the pointer then nothing is controlling what uses that memory and can be grabbed by something else
Topic archived. No new replies allowed.