Dynamic memory deallocation

why am I still able to get value of a[4] at line number 42 after deallocating the memory also,
code link: https://ide.codingblocks.com/s/479274

hello @s.kumar

deleting memory only means the memory is free to be used by any other program.

if u dont delete it then os will think that this memory is still occupied by ur program and hence it will never use this memory for any other program

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.