I wanted to inspect the address of my variable
volatile int clock;
cout << &clock;
But it always says that x is at address 1. Am
This is because there is no overload for operator << that takes a pointer to volatile, and there is no pointer conversion that could satisfy it.
According to C++ standard,
for any type
T, pointer toT, pointer toconst T, and pointer tovolatile Tare considered distinct parameter types, as are reference toT, reference toconst T, and reference tovolatile T.
Operator << has no overload for pointers to non-static member, pointers to volatile, or function pointers, so attempting to output such objects invokes implicit conversion to bool.