I have a class below:
class A
{
public:
double a;
float b;
double c;
};
I want to print data member offset in class, than I use:
double A::* pm = &A::a;
cout << *(int *)&pm << endl;
It works well and print '0', but I don't want to use intermediate variable pm
cout << *(int *)&A::a << endl;
I got compile error with : Invalid type conversion