If you are talking about raw pointers, there is no way to know that. You cnad use standard library faculties, like shared_ptr, which provides use_count() method
As I said, there is no way. It is technically impossible to make reference counting using raw pointers.
That is one of the reasons why you should not use raw pointers.
You can use std::shared_ptr:
1 2 3 4 5 6 7 8 9 10 11 12
#include <iostream>
#include <memory>
struct A {};
int main()
{
auto ptr1 = std::make_shared<A>();
auto ptr2(ptr1);
auto ptr3(ptr1);
std::cout << ptr2.use_count();
}