fork download
  1. #include <iostream>
  2. #include <stddef.h>
  3. using namespace std;
  4.  
  5. class A
  6. {
  7. public:
  8. int x;
  9. int &y;
  10. int &z;
  11. };
  12.  
  13. int main() {
  14. cout << offsetof(class A, y) << endl;
  15. cout << sizeof(class A);
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
8
24