getting error-
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\memory(1143,17): message : could be 'std::shared_ptr<int> &std::shared_ptr<int>::operator =(std::shared_ptr<int> &&) noexcept'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\memory(1132,17): message : or 'std::shared_ptr<int> &std::shared_ptr<int>::operator =(const std::shared_ptr<int> &) noexcept'
1>E:\VS\HelloWorld\HelloWorld\main.cpp(14,10): message : while trying to match the argument list '(std::shared_ptr<int>, int *)'
1>Done building project "HelloWorld.vcxproj" -- FAILED.
#include <iostream>
#include <vector>
#include <algorithm>
#include<string>
#include <memory>
using namespace std;
int main()
{
shared_ptr<int> ptr = make_shared<int>();
int l = 10;
ptr = &l;
cout << (*ptr) << endl;
cin.get();
}
Please login or Register to submit your answer