fork(1) download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. struct A{
  7. int i;
  8. int j;
  9. char c;
  10. };
  11.  
  12. struct B{
  13. string d;
  14. int i;
  15. };
  16. struct C{
  17. A a;
  18. B b;
  19. };
  20.  
  21. int main() {
  22. cout << " Size of A : " << sizeof(A) << endl ;
  23. cout << " Size of B : " << sizeof(B) << endl ;
  24. cout << " Size of C : " << sizeof(C) << endl ;
  25. return 0;
  26. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
 Size of A : 12
 Size of B : 8
 Size of C : 20