Compiler has pointed ,among other mistakes, at strings(emphasized). Have i used the shared_ptr s' wrong? Is compiler able to get in private with purpose of setting the value, by this non-explicit way?
#pragma once //(i've tried also without this)
#include <memory>
class Stack
{
private:
shared_ptr<int> n; // this string
public:
Stack();
};
//#include's
using namespace std;
Stack::Stack()
{
shared_ptr<int> n_user(new int);
cin >> *n_user;
shared_ptr<int> n(new int);
this->n = n_user;
}
Your header file needs to look like this:
#pragma once
#include <memory> // ADDED
class Stack
{
private:
std::shared_ptr<int> n; // ADDED std::
int *s_array;
std::shared_ptr<int> amount; // ADDED std::
public:
Stack();
void Push(int value);
int Get(int receiver);
~Stack();
};