In this example, two shared_ptr instances p1 and p2 are created, both pointing to the same dynamically allocated integer value of 5. Since both pointers share ownership of the same resource, the value can be modified through either pointer.c++ #include