We can get the address representation of an object in memory using
std::cout << &obj << std::endl
I am trying to do the same with a pointer-member type.
#include <iostream>
using namespace std;
struct X
{
bool b;
int a;
};
int X::* a =&X::a;
bool X::* b = &X::b;
X x;
int main()
{
cout << a << endl << b;
}
Demo
You see what I got 1. What is 1? Or should I mention pointer-to-memberhow simple a type is that is not directly tied to a "simple" pointer?
user2953119
source
share