You're misunderstanding what std::shared_ptr provides. It is a mechanism for sharing ownership of dynamic data; not attaching pointers to non-dynamic data.
In your posted code, this declares a simple int variable with initial value of 10
int x = 10;
Then this constructs a shared pointer to a new int whose only relationship to x is the value reaped from the latter to initialize the former.
std::shared_ptr<int> ptr = std::make_shared<int>(x);
In other words, for all intents in this code, the above is equivalent to:
std::shared_ptr<int> ptr = std::make_shared<int>(10);
If you want a bunch of pointers in your code to refer to x by address, first ask yourself why, then ask yourself why you're not just using references. I.e.
int x = 10;
// somewhere else
int &ref = x;
ref = 42; // will change x
If what you really want is a shared state with ownership reference counting and proper disposal mechanics therein, then you probably want:
std::shared_ptr<int> x = std::make_shared<int>(10);
// somewhere else
std::shared_ptr<int> ptr = x;
With the above code, there are two references to a dynamic int : the shared pointer x, and the shared pointer ptr. Both have equal and shared ownership of that dynamic int. When either is destroyed the resource still exists, as it is still referenced by the remaining shared pointer. When the last outstanding reference is destroyed, so too goes the dynamic int.