Suppose I have a C++ class as follows:
class Point {
// implementing some operations
}
Then:
Point p1;
Point p2 = p1;
If I want to know the address of p2, then I can use &p2
. But how can I get the address that p2 stores? Because p2 is not a pointer, so I cannot just use cout << p2;