// (2) or lambda expressionstd::shared_ptr<int>sp(newint[10], [](int*p) { delete[] p; }); // (3) or use default_deletestd::shared_ptr<int>sp(newint[10], std::default_delete<int[]>()); // (4) or we can use unique_ptrstd::unique_ptr<int[]>up(newint[10]);// t...
std::shared_ptr<int>sp(newint[10], [](int*p) {delete[]p; }); // (3) or use default_delete std::shared_ptr<int>sp(newint[10],std::default_delete<int[]>()); // (4) or we can use unique_ptr std::unique_ptr<int[]>up(newint[10]);// this will correctly call delete[...