fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct A
  5. {
  6. char x;
  7. ~A() {}
  8. };
  9.  
  10. struct B
  11. {
  12. char x;
  13. virtual ~B() {}
  14. };
  15.  
  16. int main()
  17. {
  18. cout << sizeof(A) << "\n";
  19. cout << sizeof(B) << "\n";
  20. }
Success #stdin #stdout 0s 4480KB
stdin
Standard input is empty
stdout
1
16