fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. struct t
  6. {
  7. struct e
  8. {
  9. int i;
  10. char c;
  11. }f;
  12. double d;
  13. };
  14.  
  15. struct t tt = {0};
  16. tt.f.i = 5;
  17. tt.d = 3.25;
  18. cout<<*(int*)(void*)&tt<<endl;
  19. cout<<*(int*)(void*)&(tt.f)<<endl;
  20. return 0;
  21. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
5
5