I am trying to improve my skills in C++.Suppose that i have the following piece of code
#include <iostream>
using namespace std;
int main()
{
int *p;
p=new int[10];
delete [] p;
return 0;
}
How can i use unique/shared ptr to automatically delete the array instead of doing it manually when it goes out of scope in this piece of code?BTW i have read in SO that i might need to download boost library to use a unique/shared ptr.Can anyone confirm this?Or is it included in std libraries?