fork download
  1. #include <iostream>
  2.  
  3. class A{
  4. int a,b,c;
  5. };
  6.  
  7. class B{
  8. int a,b,c;
  9. public:
  10. virtual ~B(){}
  11.  
  12. };
  13.  
  14. class C {
  15. int a,b,c;
  16.  
  17. void funcC(){
  18. }
  19. void funcCC(){
  20. }
  21. };
  22.  
  23.  
  24. int main(){
  25. A a;
  26. B b;
  27. C c;
  28.  
  29. std::cout<<"A =>"<< sizeof(a)<<std::endl;
  30. std::cout<<"B =>"<< sizeof(b)<<std::endl;
  31. std::cout<<"C =>"<< sizeof(c)<<std::endl;
  32. return 0;
  33. }
Success #stdin #stdout 0.02s 2724KB
stdin
Standard input is empty
stdout
A =>12
B =>16
C =>12