#include <vector> #include <iostream> struct A { A(int i) { std::cout << "A(" << i << ")"; } ~A() { std::cout << "~A()"; } }; int main() { std::vector<A *> a; for (int i = 0; i < 3; i++) { a.push_back(new A(i)); } return 0; }
delete
~A()
A
std::vector
Login in to like
Login in to comment
or Read more about C++ Quizzes
Login in to like
Login in to comment