As it says here: How to use delete with a variable pointed to by two pointers? one can only delete once, then all pointers won't work, but the code below:
#include<iostream>
using namespace std;
int main(){
    string * str1 = new string("abc");
    string * str2 = str1;
    cout<< *str2 <<endl;
    delete str1;
    str1 = NULL;
    cout<< *str2<<endl;
}
the output is:
abc
abc
so, what's the matter?
 
     
     
    