Suppose I have the following code. I have expected that this has to at least give me a warning.
#include <iostream>
struct test
{
int whatever;
};
int main()
{
int test::* p = &test::whatever;
std::cout << p;
}
However, I was surprised to find out that this code compiles without complaints. So I would like to know, what is actually printed in this case, how is the test::whatever
stored, so we can access its address?