Can I delete a memory previously allocated dynamically, but with a different pointer?
问题 I was making a program for linked list in C++. To implement the concept, I created a pointer 'start' globally, pointing to the first element of the list. After completion of the program I tried to delete all memory allocated dynamically to prevent memory leaks, by accessing successive nodes using the start and another locally declared pointer 'p'. Here, I used a pointer pointing to the same correct addresses, but this pointer was not the one used for memory allocation, but was declared