私は c++ が初めてで、stl コンテナーのポインターの処理がわかりにくいと感じています。stlコンテナはポインタをどのように処理しますか?
Point *p1 = new Point(10, 10);
std::vector<Point*> points;
points.push_back(p1);
delete p1; // or delete points[0]
std::cout << points[0]->getID() << "\n"; //why does this still display 10, 10 after deleting above?
std::cout << p1->getID(); //ofcourse, this one will output garbage
//getID method displays xy coordinates given as parameters when object is created
//The result displayed
10, 10
-1, 12337