// CPP program to demonstrate use of std::map
#include <bits/stdc++.h>
int main()
{
std::shared_ptr<char> pA(new char('A'));
std::shared_ptr<char> pB(new char('B'));
std::shared_ptr<char> pC(pA);
std::cout << pC.use_count() << std::endl; //2
std::cout << *pA << std::endl;//A
pA = pB;
std::cout << *pA << std::endl;//B
std::cout << pC.use_count() << std::endl; //1
}