Doubt regarding delete

In the initialintroduction to new and delete, we were told that delete keyword will only delete the pointer and not the data at that address,but now it appears to be deeleting the data and freeing up memory…
If you could please tell me what I’m missing, because I’m a bit confused regarding the delete keyword now.

Thanks in advance!

Hey @kapurm17
The delete keyword is actually used to free up the memory occupied by a dynamically generated object. Pointer itself is nothing but a way to reference the object. So deleting a pointer won’t benefit us in a useful way.
Pointers can be tricky as prateek bhaiya says so keep on working with them and soon you’ll get a handle over them.

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.