how does c++ know which variables to delete code example Example: how to delete variable in c++ string* x = new string(); //... delete x;