如何访问头文件中类的组件并打印其地址?

我开始学习C ++中的多重继承,我想从头文件中打印出类组件的地址。

原始头文件定义了几个类:

#include <iostream>
#include <iomanip>
class Account
{
  public:
  Account() {}
  unsigned long A1;
};

class Employee : public Account
{
 public:
 Employee() {}
 unsigned long E1;
};
class Student : public Account
{
 public:
 Student() {}
 unsigned long S1;
};
class Work_Study : public Employee, public Student
{
  public:
  Work_Study() {}
  unsigned long W1;
};

cpp文件如下:

Work_Study Obj_WS; // declare a Work_Study object;
Work_Study * Obj_WS_ptr = &Obj_WS; 
int main() {

    std::cout << "Employee Account" << &((Account *) Obj_WS_ptr->A1) << std::endl;
    std::cout << "Employee" << &((Employee *) Obj_WS_ptr->E1) << std::endl;
    std::cout << "Student Account" << &((Account *) Obj_WS_ptr->A1) << std::endl;
    std::cout << "Student" << &((Student *) Obj_WS_ptr->S1) << std::endl;
    std::cout << "Work_Study" << &(Obj_WS_ptr->W1) << std::endl;
    return 0;
 }

当前有两个错误:

第一个是对这些组件的含糊要求。我应该在cpp文件中再次声明该类吗?还是有其他方法?

另一个是:作为一元“&”操作数的左值。由于组件都是long unsigned int,此错误意味着什么?

在这种多重继承中,有两个Account for Employee和Student,因此,如果要访问Student帐户,则需要强制转换指针以对其进行访问,因为内存布局首先是左侧,然后才是访问Employee对象。