fork download
  1. #include <iostream>
  2.  
  3. int C;
  4.  
  5. class C {
  6. private:
  7. int i[10];
  8. public:
  9. static int f(){
  10. return sizeof(C);
  11. }
  12. };
  13.  
  14. int f(){
  15. return sizeof(C);
  16. }
  17.  
  18. int g(){
  19. return sizeof(class C);
  20. }
  21.  
  22.  
  23. int main() {
  24. class C C{};
  25.  
  26. auto h = [](){
  27. return sizeof C;
  28. };
  29.  
  30. endl(std::cout << ::f());
  31. endl(std::cout << C::f());
  32. endl(std::cout << ::g());
  33. endl(std::cout << h());
  34.  
  35. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
4
40
40
40