fork download
  1. #include <iostream>
  2.  
  3. class a
  4. {
  5. char *p;
  6. };
  7. class b
  8. {
  9. char &r;
  10. b(); //these are just so the example compiles
  11. b(const b &);
  12. b &operator=(const b &);
  13. };
  14.  
  15. int main()
  16. {
  17. std::cout << sizeof(a) << std::endl;
  18. std::cout << sizeof(b) << std::endl;
  19. }
Success #stdin #stdout 0.02s 2724KB
stdin
Standard input is empty
stdout
4
4