Guest User

Untitled

a guest
Feb 9th, 2020
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. struct Blah{
  2. char c;
  3. int a;
  4. };
  5.  
  6. int main()
  7. {
  8. Blah b[100];
  9.  
  10. std::cout << offsetof(Blah, c) << std::endl;
  11. std::cout << offsetof(Blah, a) << std::endl;
  12. std::cout << sizeof(Blah) << std::endl;
  13. std::cout << &b[0] << std::endl;
  14. std::cout << &b[1] << std::endl;
  15. }
  16.  
  17. ---------
  18.  
  19. Output:
  20.  
  21. 0
  22. 4
  23. 8
  24. 00EFFAB0
  25. 00EFFAB8
Advertisement
Add Comment
Please, Sign In to add comment